Malian soldiers arrested Prime Minister Cheick Modibo Diarra late on Monday as he tried to leave the country for France, a spokesman for the military said.
"He wanted to leave the country having incited trouble," said Bakary Mariko, a spokesman for the group of soldiers who seized power in a March coup. The group remains powerful despite officially handing power back to civilians earlier this year.
Diarra's arrest was confirmed by a diplomat in Mali.
The move will complicate efforts to stabilise the West African nation, where soldiers and politicians remain divided since the coup and where the north of the country is occupied by al Qaeda-linked Islamist fighters.
Residents in Bamako said the town was quiet in the early hours of Tuesday morning.
Mariko gave no further details on the arrest but tensions had been growing between the former junta and Diarra, a former NASA scientist and Microsoft chief for Africa, who has been interim prime minister since April.
West African leaders and Western nations have warned that Mali's north has become a safe haven for terrorism and organised crime, but they have struggled to draw up plans to help the country due to the deep divisions in the capital.