Venezuela’s government said explosives carried by drones were detonated near President Nicolás Maduro and his entourage at a military ceremony Saturday in what the leader called an assassination attempt by right-wing foes.

Mr. Maduro was unharmed, but the blasts injured seven soldiers taking part in a military parade honoring the National Guard in the capital of Caracas, the government said.

“It...