Heavy gunfire was reported in Guinea-Bissau's capital on Friday morning hours after some National Guard soldiers went to free a detained minister and a senior state official.
Members of the National Guard took the officials before seeking refuge in barracks south of the capital.
Special forces then intervened after attempts to negotiate failed, resulting in an exchange of gunfire.
Calm is said to have been restored later.
The leader of the group of soldiers who were trying to free the two men is now being held by the army and the "situation is completely under control", the AFP news agency quotes an army spokesman as saying.
Finance Minister Souleiman Seidi and António Monteiro, the secretary of state for the treasury, had been detained amid investigations into the alleged irregular withdrawal of $10m (£8m) of state funds.
They were questioned on Thursday afternoon by an anti-corruption inquiry to clarify the payments to 11 companies.
In a parliamentary session on Monday, the leader of the country's main opposition party alleged that the owners of the companies were close to leaders of the country's governing coalition.
Mr Seidi defended the payments as legal.
On Thursday after the questioning, Mr Seidi and Mr Monteiro were arrested and detained so as not to jeopardise the investigations, local media said.
National Guard soldiers later in the evening invaded the police cells, located near Bandim market, "with AK-47 weapons and bazookas" and extricated the detained officials, the privately owned O Democrata news outlet reported.
It said the National Guard took them to an unknown location.
President Umaro Sissoco Embalo is currently out of the country, attending the UN's COP28 climate conference in Dubai.
On Friday morning, regional stabilisation forces deployed by the regional West African bloc Ecowas were seen patrolling the streets, the AFP news agency reported.
Guinea-Bissau has suffered a series of coups and attempted coups since gaining independence from Portugal in 1974.
In February last year, the president said he survived a coup attempt after being under heavy gunfire for five hours - in an incident in which 11 people died.
Without providing details, he said the attack was linked to drug trafficking in the country.
Some however doubted the official version of the events, amid questions including who was really behind the attempt, how many people were involved and who was in command.