A young man punched Prime Minister Mariano Rajoy of Spain in the face during a campaign event on Wednesday, leaving the stunned leader with broken glasses and bruises.

The prime minister appeared to be speaking with another person on a street in the city of Pontevedra in northwestern Spain when the attacker, who Spanish news media reported was 17, struck Mr. Rajoy’s left cheek, according to The Associated Press. The boy was quickly detained.

Mr. Rajoy tweeted that he was fine, but he appeared to have a red mark across his face at a later campaign stop in a nearby city.