Ecuador's leader Daniel Noboa emerged without injury following his presidential motorcade was targeted by stone-throwing demonstrators and what authorities described as possible gunfire.
The president was inaugurating a water treatment plant in the country's central region when his motorcade was set upon by a large group demonstrating against increasing energy costs.
About 500 people showed up and were throwing stones at him, and there are clearly bullet marks on the president's car
commented Ecuador's environmental official.
Authorities reported that five individuals were detained and would stand trial on terrorism accusations – an crime carrying a highest penalty of three decades in jail.
Recorded material made public by the administration shows demonstrators positioned in the street, covered in banners, scrambling to collect large stones and building blocks.
As the official vehicle passed, projectiles thudded into the paneling and shattered glass.
Someone could be heard shouting: "Heads down! Get down!" as the car accelerated from the scene.
Officials indicated they were still investigating whether certain of the damage on the president's protected vehicle were resulted from bullet impacts.
The alleged incident came amid several days of increasingly violent protests triggered by a administration's move to raise fuel costs.
Protesters have gone on strike, obstructed highways and abducted 16 soldiers – who were subsequently released unharmed.
The country's largest native group reported that a demonstrator had been fatally injured by armed forces during one of the protests.
Over 100 people, including protesters and security services, are believed to have been injured in the violence.
Noboa has imposed a state of emergency across several regions.
The presidential administration stated on digital platforms following the attack that "cowardly acts will not stop" the leader.
The head of the regional organization said that "such violent acts are an attack on democracy, stability, and the spirit of harmonious living that must dominate in our nations."
Noboa is trying to cut diesel subsidies to conserve about $1bn in government spending, redirecting much of the savings to safety initiatives.
The nation, previously regarded one of the region's most secure countries, has seen a dramatic surge in criminal activity in recent years.
Positioned between Colombia and Peru, two of the planet's biggest cocaine producers, the country has become a major transit hub for illegal drugs.
Officials have alleged drug gangs of fueling the protests, suggesting that illegal organizations are taking advantage of the protests to disrupt the country.
It is estimated that 70% of the world's cocaine supply passes through Ecuador, a large portion of it destined for the United States.
The trade has drawn global crime syndicates, including Mexican drug cartels, Italy's 'Ndrangheta, and Albanian criminal networks.
Their competition for control of trafficking routes has transformed the nation into one of the area's highest-risk places.
The president has called for a referendum to allow the presence of American military to the nation, repealing a 2009 ban on international military installations.