The Ecuadorian presidential candidate Fernando Villavicencio has been shot dead as he left a campaign event in Quito, days before an election where the central issue is the rise violence and crime.

Videos on social media show Villavicencio, a former journalist who had collaborated with the Guardian and was outspoken about alleged links between organised crime and politics, surrounded by supporters and being escorted by security guards to a waiting vehicle when gunshots ring out as people start to scream and take cover.

In a televised address made after midnight, the country’s president, Guillermo Lasso, said the elections would continue as planned, though under a two-month state of emergency in which soldiers would guard polling stations.

Flanked by cabinet members and electoral authorities, he said: “We agree in the face of the loss of a patriot and a fighter, elections should not be suspended; on the contrary, they should be held and democracy should be strengthened.”

He announced three days of national mourning.

“I want to say to those who want to threaten the state, we will not hand over the power and the democratic institutions to organised crime even though it is disguised as political organisations,” he added.

A suspect in the killing died from injuries sustained during the shootout that ensued, the attorney general’s office said, with six arrests made in connection with the attack.

Speaking at the scene of the shooting, Villavicencio’s uncle, Galo Valencia, blamed the state for not giving his nephew enough security and described how he thought the gunshots were fireworks launched by supporters until “we saw that there were wounded falling, blood, injured people”.

“What we witnessed was like a horror film. The death of my relative. I have no words for what’s happening in the country. They just killed democracy,” he said.

“What insecurity we live in … if a man who fought more than 20 years, the most likely to win the elections, is silenced. Is this the way to win elections?”

The assassination comes amid a sh0cking surge in violent crime in the small South American country, as rival drug-trafficking gangs perpetrate prison massacres and murder rates have more than doubled between 2020 and 2022. Lasso said after Wednesday’s killing: “Organised crime has gone too far but they will feel the full weight of the law.”

Villavicencio was one of eight presidential candidates running in early elections due to be held on 20 August. More than half of Ecuadorians said in a poll that fixing the country’s insecurity problem was their biggest priority.

A witness to the attack, who did not wish to be identified, said he initially thought the gunshots were fireworks. “We never imagined the tragedy that we are now living in the country. This is terrorism.

“If this can happen to a candidate who supposedly had security and contacts then anyone can be killed. It leaves a clear message that here life is worth nothing.”

Villavicencio’s fellow candidates expressed remorse. Otto Sonnenholzner, tweeted: “Our deepest condolences and deep solidarity with the loved ones of Fernando Villavicencio. May God keep him in his glory. Our country has gotten out of hand.”

His fellow presidential hopeful Jan Topic said: “Today more than ever, the need to act with a strong hand against crime is reiterated. May God have him in his glory.”

Days before his murder, Villavicencio, who was 59, had said on national television that he had received several death threats that he alleged came from the jailed leader of the Choneros gang, Alias Fito, ordering him to stop mentioning his name.

Villavicencio, from the Andean province of Chimborazo, was the candidate for the Build Ecuador Movement. He was a former union member at the state oil company Petroecuador and later a journalist who denounced alleged millions in oil contract losses.

He was one of the most critical voices against corruption, especially during the 2007-17 government of the former president Rafael Correa, and was sentenced to 18 months in prison for defamation over statements made against the former president.

“Ecuador has become a failed state,” tweeted Correa after the killing. “Those who seek to sow even more hatred with this new tragedy, I hope they understand that it only continues to destroy us.”

In 2014, Villavicencio fled to Indigenous territory within Ecuador and later, in 2017, was given asylum in Peru. He spent time in the Indigenous Kichwa community of Sarayaku in Ecuador’s Amazon. At the news of his killing, the community’s leader, Patricia Gualinga, said: “I am crying and very distressed because he was a personal friend.”

“Sarayaku gave him asylum,” Gualinga, an Indigenous activist who was at the Amazon summit in Belém, Brazil, told the Guardian. “Fernando said if we handed [him] over [he] would not survive,” she said, describing him as “familiar and kind figure” who gave talks at local schools.

As a legislator, Villavicencio was criticised by opposition politicians for obstructing an impeachment process this year against Lasso, which led the latter to call the early elections.

— The Guardian