CARACAS, Venezuela — A drone attack caused pandemonium at a military ceremony where President Nicolás Maduro of Venezuela was speaking on Saturday, sending National Guard troops scurrying in what administration officials called an assassination attempt.

The president, who was unharmed, later told the nation, “To all of our friends in the world, I am fine, I am alive.” He blamed right-wing elements and said, “The Bolivarian revolution keeps its path.”

Mr. Maduro has presided over a spectacular economic collapse in Venezuela, where inflation is expected to reach one million percent this year despite the country’s large oil reserves. Economists blame decades of mismanagement under Mr. Maduro and his predecessor, Hugo Chávez.

The drone attack was the latest in a string of attempts in recent years to end the tenure of Mr. Maduro, who was declared the victor of an election in May that carries his term until 2025. No previous assaults have been as bold, though, and this appeared to have been the first assassination attempt on a head of state using drones.

It was an attack that seemed scripted for Hollywood: Off-camera explosions. Low-flying drones exploding midair. The president and first lady ducking for cover. Thousands of soldiers in a military parade suddenly fleeing in a stampede that was broadcast to the country, live.