Officials in Poland say three men have been caught red-handed while planting homemade explosives under two police cars in Warsaw.

It is a second case since Thursday in Poland of homemade explosives threatening public security. Poland is to host the NATO summit and a visit by Pope Francis in July.

Police spokesman Mariusz Mrozek said Wednesday that the men, aged between 17 and 35, were linked to anarchist groups and have not explained why they tried to destroy cars in a police parking lot Monday night.

If convicted of threatening public security, they could face up to eight years in prison.

Separately, a 22-year-old student confessed to leaving homemade explosives Thursday on a city bus in Wroclaw in the southwest. One person was slightly hurt when they exploded.