Haitian president Michel Martelly and his accompanying motorcade have been attacked as he strolled in the capital Port-au-Prince.
A National Palace statement said "troublemakers" who had taken refuge in a university were responsible for the attack on Mr Martelly in a carnival procession near the Champs de Mars plaza.
Witnesses said rocks were thrown at the president from behind the University of Haiti. The public plaza where the attack happened has been home to nearly 20,000 people who were displaced by the 2010 earthquake.
Stanley Lazard, 25, said he saw Mr Martelly hit in the shoulder by a rock. The president "almost fell", said. "Two security guards embraced him and put him in the car."
The presidential office and witnesses said Mr Martelly had been taken without injury to the nearby National Palace.
Police responded by firing shots in the air and unleashing tear gas as rocks were lobbed over the university fence, Mr Lazard and others said.
Mr Martelly left the National Palace about an hour later and walked under a heavy police presence, before returning to the presidential residence.
The episode led to clashes between students and Martelly supporters, who tore down a fence and entered the school grounds. Students said the president's backers smashed windows of cars that were parked in the courtyard of the university.
"The people with the president, they came inside and started throwing stones at the students," said sociology student Frantz Legros, 22. "They came to the front to beat the students."
The attack on the president was the second since he was inaugurated last May. Two months later, protesters lobbed rocks and bottles at him and his entourage as they walked through a street in Cap-Haitien, Haiti's second largest city. Mr Martelly was not injured.