Diancounda Traore, Mali's interim president, is recovering from head injuries he sustained after protesters angry at his appointment in a deal struck with the military rulers burst into his office and beat him.
Traore was rushed to Point G Hospital after Monday's attack, which left three people dead, said Sekou Yattara, a medical student there.
The interim leader arrived at the hospital unconscious though he regained consciousness later, Yattara added, explaining that he learned of the president's condition from the doctors treating him.
"He has been badly injured but the information I have is that his life is not in danger," said Iba N'Diaye, the vice president of Traore's party. "This was an attempt on his life."
A UN envoy said the attack "seriously" endangered diplomatic efforts to resolve Mali's crisis, suggesting that "maybe other options will now have to be considered".
Protesters evaded security and pushed their way into Traore's offices in Koulouba, the headquarters of the general secretariat next to the presidential palace, which has stood looted and empty since the March 21 coup.
Live Box 2012323113540794475
"The protesters, who were many, evaded security forces ... they found him in his office. He was beaten but his life is not in danger. He was driven to hospital," a source in the presidency said.
Traore was released after undergoing an examination.
"He had a scan which showed no serious injury," said a doctor speaking on condition of anonymity, adding that after leaving the hospital Traore had been driven to a secure location.
Prime Minister Cheick Modibo Diarra appealed for calm, saying the attack was "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 [protest] marches."
The incident comes a day after the Economic Community of West African States (ECOWAS) brokered a deal with the junta, prompting relief in the country after weeks of deadlock on the way forward.
"We are all leaving, with the feeling that we have accomplished our mission" set by ECOWAS, Adama Bictogo, the Ivory Coast minister of African integration, told the AFP news agency earlier on Monday.
Captain Amadou Sanogo, who led the coup, was threatening to derail the transition back to democratic rule by blackballing recommendations that current interim leader Traore, 70, remain in his position for a 12-month period.
Laborious talks had failed to yield a positive result and Traore was due to step down on Wednesday after a constitutionally mandated 40-day interim presidency, which would have plunged the institutions back into crisis.
But on Sunday Sanogo accepted a sweetened deal as he was offered all the benefits that a former president would be owed: housing, transport, security and an allowance.
Thousands of Malians took to the streets on Monday to protest the transition deal.
"The arrangements made by ECOWAS don't involve Malians. It is a betrayal," said Hamadoun Amion Guindo of the Committee of Malian Patriotic Organisations (COPAM), a pro-coup grouping opposed to Traore.
Some protesters accused Sanogo of "treason" for accepting the arrangement.
One of west Africa's most stable democracies, Mali was plunged into crisis when Sanogo led a band of low-ranking soldiers to oust Amadou Toumani Toure's government.
On April 12 the putschists agreed on a return to civilian rule and Traore was inaugurated as interim leader and formed a government, but the former junta refused ECOWAS proposals that he stay on for a 12-month transition period.
Politicians felt Sanogo had done an about-turn and was jockeying to lead the transition himself.
"We have come a long way, we were a hair's breadth away from an impasse," said Malian journalist and political commentator Tiegoum Boubeye Maiga of the deal.
"On paper the matter is wrapped up. Now it remains to be seen how it will work. I am hopeful. It is important to have given Sanogo the title of former head of state," he added.
In carrying out the coup, the soldiers claimed that the government was incompetent in handling a Tuareg rebellion in the northern desert that began in January.
But the coup only opened the way for the Tuaregs and a motley group of fighters calling for Islamic rule backed by al-Qaeda in the Islamic Maghreb and criminal bands to seize the northern half of the country, an area larger than France.
Convinced that tensions in Bamako had eased, analysts said leaders could now turn to the north.
"Here you have a country which was on the brink of catastrophe in the south, and suddenly finds itself back on the rails. Now we can focus on northern Mali. The junta did not lose face, and democracy triumphed," Mamadou Samake, a political analyst, told AFP.
Source: Al Jazeera and agencies