A man armed with a replica pistol has fired at Czech President Vaclav Klaus at close range while he was opening a bridge in the north of the country.
Footage of the incident from Czech television show Mr Klaus recoiling slightly but carrying on with the visit apparently unhurt.
Mr Klaus was taken to hospital but suffered only minor bruising.
His security detail has come in for harsh criticism for allowing the man to get so close to Mr Klaus.
It's also unclear why Mr Klaus' bodyguards failed to react when a gun was pulled on him, the BBC's Rob Cameron reports from Prague.
Mr Klaus himself rebuked them for failing to handle the situation well, according the Nova TV station.
He later said the incident happened so quickly he did not have time to be afraid, our correspondent adds.
The attacker, who was dressed in camouflaged clothing, pushed his way through a crowd in the town of Chrastava before firing the weapon at Mr Klaus.
The weapon was of the sort that is used in "airsoft" gaming.
The man was briefly interviewed by Czech media and said he was a 26-year-old communist sympathiser.
He said he had carried out the attack because the government was deaf to the concerns of ordinary people.
The man was arrested by police shortly afterwards.
Mr Klaus has been in the largely ceremonial post of president since 2003 and previously served as prime minister in the 1990s.
He is known for pushing through reforms to the Czech Republic's economy after the fall of Communism and is a staunch opponent of EU integration.