Several people have been injured, but none seriously. So far, the foreign inmates are all safe.
"We want to evacuate them immediately for their own safety," said Col. Wing Handoko, a military spokesman. "We need to make sure they aren't used by other prisoners to get international attention or as bargaining chips for their demands.
"We don't want them to be taken hostage."
More than 120 female inmates and 13 children also would be relocated, he said.
The violence that erupted late Tuesday at the Kerobokan jail -- which houses more than 1,000 drug traffickers, sex offenders and other violent criminals -- was triggered by the stabbing of an inmate during a brawl a week ago.
The prisoners wanted to know how a knife made its way in. They blamed guards, saying security was too lax.
By Wednesday night, the inmates had chased away all 13 guards and seized full control of the compound, said Beny Arjanto, the local police chief.
As midnight neared, some climbed to the top of the watch tower and started throwing rocks and a Molotov cocktail at more than 500 soldiers and police stationed outside. Others tried to break down the front gates.
Troops responded by firing tear gas and shots in the air. Others stormed the facility, but they were forced back out 10 minutes later, said Arjanto.
So far, no foreigners have been hurt, said Ngurah Hartawan, a prison doctor who briefly made it inside.
One inmate was cut on the hand and arm, and two had fevers, but the tensions made treating them impossible, he said.
The Kerobokan prison about 20 minutes from Bali's international airport was built for around 300 prisoners but houses more than three times that. Roughly 60 are foreigners, including 12 Australian drug traffickers and an American convicted of drug possession, said Anang Khuzairi, a prison official.
Foreign inmates, women and children would be evacuated Thursday, Handoko said, as nearly a dozen, large trucks started arriving Thursday to assist in the process.
Though he would not elaborate, another police officer told The Associated Press they would be taken to Klungkung, another prison about 40 miles (70 kilometers) away.
He spoke on condition of anonymity because he was not allowed to speak to the media.