Spanish Prime Minister Mariano Rajoy has been slapped in the head during a campaign appearance, reportedly by a teenager.

Development Minister Ana Pastor tweeted confirmation of the incident Wednesday evening in front of a church in the northern city of Pontevedra.

It's in the Galicia region where Rajoy grew up and was campaigning for his Popular Party before Sunday's general election.

Spain's state-owned RTVE news channel reported on its website that the impact of the blow sent Rajoy's glasses flying to the ground.

RTVE says security agents detained the attacker, who wasn't identified. Some reports say he is 17 and that he asked Rajoy for a photo.

Polls say the Popular Party will win but won't regain the majority it has in parliament following years of unpopular austerity cuts.