The incident happened on Wednesday when Mariano Rajoy was mingling with crowds in Pontevedra city in his northwestern fiefdom of Galicia on the latest stop of his push for re-election in Sunday general elections.
Spain's PM Rajoy punched in face on election walkabout
The teenager approached and hit the prime minister hard on the left side of his face, knocking off and breaking his glasses before being wrestled to the ground by Rajoy's bodyguards.
A photo posted after the incident pictured Rajoy without his glasses, red marks on the left of his face and neck, but the premier was not badly hurt and continued his walk through the city.
The High Court of Galicia announced Thursday that a court in Pontevedra had sent the teenager to a youth detention centre. "He will be locked up in the centre... for a maximum period of six months," it said, awaiting a final ruling on the case by a juvenile court in Pontevedra.
Spain holds three suspected Islamic State recruiters
Rajoy went on to appear as planned at a campaign meeting Wednesday evening, and travelled to Brussels on Thursday for the last EU leaders' summit of his four-year term.
Spanish television showed Rajoy surrounded by Germany's Angela Merkel and Britain's David Cameron on the sidelines of the summit.
Merkel was pictured reaching out for Rajoy's left cheek, in what was interpreted as a sign of concern for the Spanish leader after the assault.
COMMENTS
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ