Rival groups of soldiers in Burundi are vying for control of the capital Bujumbura amid confusion over the success of an attempted coup.
Fighting has been reported around the state TV and Bujumbura airport.
A senior military source has told the BBC that soldiers loyal to President Pierre Nkurunziza are back in control of key parts of the city. Coup leaders insist they remain in charge.
The unrest began when Nkurunziza announced he was seeking a third term.
Opponents say the bid contravenes the constitution. Mr Nkurunziza came to power in 2005.
The coup was announced by Maj Gen Godefroid Niyombare, a former intelligence chief and ally of the president, after Mr Nkurunziza left for regional talks in Tanzania on Wednesday.
“The masses vigorously and tenaciously reject President Nkurunziza’s third-term mandate. President Pierre Nkurunziza has been relieved of his duties,” he said in a radio broadcast.
In an address on a private radio station, Gen Niyombare said the government was dissolved
Thousands of people took to the streets to celebrate the announcement, marching on the centre of Bujumbura alongside soldiers and two tanks.
But overnight, the army chief of staff – a supporter of the president – announced the coup “has been stopped” after talks with the defence minister, who backs the overthrow.
And President Nkurunziza tweeted on Thursday that the situation is under control and “constitutional order has been safeguarded”.
Troops loyal to the president have seized back full control of the presidential palace, the national radio and television station, the airport and the centre of Bujumbura, a senior military source told BBC Afrique.
But this has been contradicted by the coup leaders, one of whom said they are in control of “virtually the entire city” of Bujumbura.
“The soldiers who are being deployed are on our side,” coup spokesman Venon Ndabaneze also told the AFP news agency.
The scenes of joy in the streets on Wednesday have been replaced by an uneasy silence, interrupted by sporadic gunfire. The streets of Bujumbura are deserted. It has been an anxious night.
People have their ears stuck to their radio sets, listening to the only two private broadcasters still running. One of the two was attacked overnight. The popular RPA – Radio Publique Africaine, which broadcast an interview with Gen Niyombare on Wednesday – was also targeted and had to shut down.
The usually vibrant private media play a key role in shaping opinion here, and President Nkurunziza’s supporters have been targeting them since the beginning of the crisis.
A lot of the tension overnight was also concentrated around the national broadcaster, which is strategic because it is the only outlet still broadcasting outside the capital.
Wednesday’s events unfolded after President Nkurunziza flew to the Tanzanian capital Dar es Salaam for a meeting with other East African leaders to discuss the crisis.
Officials there told the BBC that he had flown back to Burundi upon learning of the coup.
But the airport and borders were ordered to be closed by Gen Niyombare, and so Nkurunziza had to return to Dar es Salaam.
A senior Tanzanian presidential security official told the AFP that he is currently in a secret location in Dar es Salaam.
Protesters are angry at the attempt by the president to gain a third term
Nkurunziza has ruled out delaying next month’s elections
His fellow leaders at the summit in Tanzania condemned the coup.
The UN and US has urged all sides to show restraint.
The unrest began on 26 April and has led to the deaths of more than 20 people.
Tens of thousands of Burundians have fled to neighbouring states in recent weeks.
President Nkurunziza, 51, has rejected calls to postpone next month’s election.
He argues that he is entitled to run for a third term because he was first appointed to the role by parliament in 2005, rather than being elected.
The constitution states a president can only be elected to two terms in office, but earlier this month the country’s constitutional court upheld Mr Nkurunziza’s interpretation