Fernando Villavicencio, 59, was shot dead after leaving a campaign rally at a school in the capital, Quito, on Wednesday evening, according to news reports.
Nine other people were injured, including a candidate for the legislature and two police officers.
The attack occurred just two weeks before the election on 20 August and amid an escalation of violence and crime.
The UN system in Ecuador called for an investigation “so that there is no sense of impunity, and to redouble efforts to stop this wave of violence that is sadly affecting all the country’s population,” said UN deputy spokesperson Farhan Haq, speaking in New York on Thursday.
From Geneva, UN High Commissioner for Human Rights, Volker Türk, condemned what he called "this shocking criminal act".
He stressed the importance of promptly carrying out a transparent, thorough, and independent investigation to hold those responsible to account.
"Violence against political candidates is a serious threat to the electoral process and the people’s ability to express their democratic will," he said.
Mr. Türk recalled that in July he had expressed deep concern over the recent spike in violence in Ecuador, including attacks and threats against political candidates, other public figures, and journalists.
He said the incident underscored the challenges the country and people are facing amid the escalation.
“I urge the authorities to increase their efforts to strengthen protection measures for political candidates, public officers and journalists, and to protect people’s lives and personal integrity in line with international human rights standards to avoid the repetition of such a tragic crime,” he added.
“Attacks of this nature represent a grave threat to democracy, and those responsible must be brought to justice,” it said.
Mr. Guterres expressed solidarity with the Government and people of Ecuador, especially the late politician’s family.
The Secretary-General also recalled his meeting with President Guillermo Lasso on 21 July, where they discussed the deterioration of security in Ecuador, the impact of organized crime, and the need to enhance national and international efforts to fight it.
“The United Nations stands ready to continue to support the Ecuadorian authorities with a view to addressing the violence in keeping with international human rights norms and standards,” the statement concluded.