A mob stormed government buildings and attacked Dioncounda Traoré, 70, in protest at a deal designed to move Mali on from the military coup which overthrew the government in March.
Soldiers loyal to the coup leaders are believed to have ushered the mob into the offices and guided them to the attack on Mr Traoré, an elderly politician appointed caretaker president under the terms of the deal.
His bodyguards were reported to have killed three of the protesters but were overrun and unable to protect Mr Traoré as he was kicked and punched by the crowd.
Although he later regained consciousness in hospital and his injuries are not thought to be life threatening, the protests badly rattled the interim government and demonstrated its weakness in the febrile post-coup environment.
The attack came just a day after African mediators had secured an agreement which would see Mr Traoré in office for a year ahead of fresh elections.
The coup’s leader, Captain Amadou Sanogo, initially rejected the deal but eventually agreed after after being offered housing and transport benefits usually given to former presidents.
But thousands of Malians took the streets in anger over the agreement, with some accusing Captain Sanogo of treason for accepting it.
Last night, Gerard Araud, France’s UN ambassador, warned that the deal had been “put seriously in danger by these latest developments and maybe other options will now have to be considered.”
Prime Minister Cheick Modibo Diarra tried to regain control in Bamako, Mali’s capital, by appealing for calm and calling the attack “not worthy of our country.”
Speaking on state television, he said: “Mali doesn’t deserve this. I call on the people, especially the young people, to put an end to marches.”
Captain Sanogo and his band of low-ranking soldiers overthrew the democratic government in March, claiming that it had failed to deal with a Tuareg rebellion that broke out in the country’s north in January.
However, the coup created a power vacuum for the nomadic tribues and Islamists rebels who seized control of most of Mali’s north, an area larger than France.