PM Diarra
Mali's then interim PM Diarra speaks during a news conference at the Ivorian presidential palace in Abidjan - Reuters

Mali Prime Minister Cheick Modibo Diarra has resigned after being arrested by soldiers who led a coup in the landlocked African nation in March.

"Men and women who are worried about the future of our nation, you are hoping for peace. It's for this reason that I, Cheikh Modibo Diarra, am resigning along with my entire government," said Diarra while announcing his resignation on state television.

Diarra was detained from his home in capital Bamako late on Monday as he was preparing to leave the country to France.

"He wanted to leave the country having incited trouble," said the military spokesperson Bakary Mariko.

A person who accompanied the prime minister told the AFP that Diarra "was arrested by about 20 soldiers who came from Kati" adding that "they said Captain Sanogo sent them to arrest him," referring the coup leader Captain Amadou Haya Sanogo.

Reports suggest the premier was handled "violently" before the arrest. The soldiers "smashed in the door of the prime minister's residence and took him away a bit violently," said one of the members of Diarra's entourage.

Diarra cancelled his plans to travel to Paris for a medical check-up as he learnt that his baggage was taken off from the aircraft that forced him to stay back at home.

Diarra, a noted businessman and former NASA astrophysicist was appointed soon after the coup in March to bring in stability to the region. He had also served as Microsoft's head for Africa.

Diarra was leading an interim government since April.

In recent weeks, uneasiness was mounting between the civilian-nominated Diarra and the soldiers who led the coup.

The detention of Diarra is set to jeopardise the efforts to establish stability in the region as the northern part of the country has also been occupied by al-Qaida-backed Islamists and Tuareg rebels.

African nations and the UN are concerned that the northern part is quickly turning into a hub for militants.