Fifteen years of leftist rule hangs in the balance as Uruguay faces a tight presidential election that is likely to head to a runoff vote.

The left-leaning Broad Front coalition has governed the small South American nation since 2005 and its achievements include laws to approve gay marriage and the creation of the world's first national marketplace for legal marijuana.

But opponents have capitalized on growing disenchantment with the government over slowing economic growth and rising insecurity.

Presidential frontrunner Daniel Martinez, of the ruling party Broad Front, speaks to supporters during his closing campaign rally in Montevideo, Uruguay, Wednesday, Oct. 23, 2019. Martinez, a former mayor of Uruguay's capital, will face off against the son of a former president in upcoming Oct. 27 general elections. (AP PhotoMatilde Campodonico)

Presidential frontrunner Daniel Martinez, of the ruling party Broad Front, speaks to supporters during his closing campaign rally in Montevideo, Uruguay, Wednesday, Oct. 23, 2019. Martinez, a former mayor of Uruguay's capital, will face off against the son of a former president in upcoming Oct. 27 general elections. (AP PhotoMatilde Campodonico)

Polls give the Broad Front's Daniel Martínez, the socialist former mayor of Montevideo, an edge over his strongest rival, Luis Lacalle Pou, a centrist former lawmaker from the National Party. But neither is expected to get the 50% plus one vote needed to win outright and avoid a runoff in November.

With the Broad Front at the helm, Uruguay has seen significant economic growth. Poverty has dropped dramatically, to 8.1%, while the legalization of gay marriage, abortion, and the sale of marijuana in pharmacies has strengthened the country's reputation as a trailblazer in the region.

"Even though I'm a Christian and I'm not in favor of things like legalizing abortion, I'm voting for the Broad Front because the country has progressed, people are better off," said Nicolás Robledo, 24, who works at car wash. "Who could buy themselves a car before?"

A boat flies a flag from Uruguay's ruling party Broad Front as it navigates off the coast before a closing campaign rally for presidential frontrunner Daniel Martinez in Montevideo, Uruguay, Wednesday, Oct. 23, 2019. Martinez, a former mayor of Uruguay's capital, will face off against the son of a former president in Uruguay's upcoming Oct. 27 general election. (AP PhotoMatilde Campodonico)

A boat flies a flag from Uruguay's ruling party Broad Front as it navigates off the coast before a closing campaign rally for presidential frontrunner Daniel Martinez in Montevideo, Uruguay, Wednesday, Oct. 23, 2019. Martinez, a former mayor of Uruguay's capital, will face off against the son of a former president in Uruguay's upcoming Oct. 27 general election. (AP PhotoMatilde Campodonico)

But the current administration of Tabaré Vázquez has been hampered by scandals that have taken a bite out of its approval ratings. Vice President Raúl Sendic had to resign in 2017 over corruption allegations, the government has failed to address a dismal high school graduation rate, and a record 414 homicides last year have made public safety an urgent issue.

"I think Martínez is a good person, but I'm not voting for him because I don't want the Broad Front to win and open the door for some of the shameless people in this government to show up," said Susana López, a 60-year-old shop worker.

Martínez, a 62-year-old engineer who has held posts in government and the private sector, has urged voters to stick to the process of "change and social justice" that his party promotes.

A supporter of presidential frontrunner Daniel Martinez, of the ruling party Broad Front, cheers during his closing campaign rally in Montevideo, Uruguay, Wednesday, Oct. 23, 2019. Martinez, a former mayor of Uruguay's capital, will face off against the son of a former president in upcoming Oct. 27 general election. (AP PhotoMatilde Campodonico)

A supporter of presidential frontrunner Daniel Martinez, of the ruling party Broad Front, cheers during his closing campaign rally in Montevideo, Uruguay, Wednesday, Oct. 23, 2019. Martinez, a former mayor of Uruguay's capital, will face off against the son of a former president in upcoming Oct. 27 general election. (AP PhotoMatilde Campodonico)

Lacalle Pou, 47, who was the runner up in the 2014 election, has a political pedigree, with a father who was president and a mother who was a senator. He has been plugging his own policies and those of a range of other parties from the center-left to the right that he hopes will help him form a government.

Although the Broad Front leads in the polls, political scientist Adolfo Garcé said a second round win could be difficult. A number of other parties have already declared their intention to support the National Party or the candidate with the strongest chance of beating the incumbent in a second round.

Uruguayans will also elect 99 deputies and 30 senators and they will be voting on a series of referendums on tough on crime measures. They include introducing possible life imprisonment for the most serious crimes, creating a new unit of the military to help with public safety, and scrapping early release of prisoners convicted of the worst offences.