The 60-year-old astrophysicist and former chairman of Microsoft Africa was seized
home by soldiers late on Monday and hours later at dawn went on state television to announce he was stepping down.
He appeared drawn as he announced that he and his government were resigning, after pressure from influential former putschists who are opposed to a military intervention to drive out Islamists occupying the country's north.
"These developments underline the need to deploy an African stabilisation force. The former junta must stop interfering in national politics," said French foreign ministry spokesman Philippe Lalliot. He called for a "new representative government. . . to be set up quickly."
Diarra's resignation came a day after the EU approved plans to deploy a military training mission of some 250 troops Mali to help the government regain control of the vast semi-desert north from Islamic extremists.
EU foreign policy head Catherine Ashton called on Mali to appoint a new prime minister acceptable to all sides and also urged the military to cease interfering in political life.
A spokesman for Ashton said preparations for a training mission would continue.
The former premier was a staunch advocate of French-backed plans to send in a west African intervention force to drive out the extremists, who are running the zone according to their interpretation of sharia Islamic law.
Citizens have been flogged, had their hands amputated and been stoned to death as punishments for transgressions.
Such foreign intervention is fiercely opposed by Captain Sanogo, leader of the March 22 coup, who still wields considerable influence in Bamako, despite handing over power to an interim government after the coup.
Diarra was preparing to leave Bamako to fly to Paris for medical treatment when around 20 soldiers arrived at his home last night.
A witness told RFI that the soldiers told Diarro that they had been sent by Capitain Sanogo.
Diarra was then driven in an armed convoy to make his resignation speech, according to the same witness.