LA PAZ, Bolivia — President Evo Morales came out ahead in the first round of Bolivia's presidential election, but he appears to have failed to get enough votes to avoid the first runoff in his nearly 14 years in power.

The preliminary results released late Sunday dealt a harsh blow to South America's longest serving leader in what has become the tightest political race of his life. But Morales, who is seeking a fourth term, still declared victory and told supporters at the presidential palace that "the people again imposed their will."

The Andean country's top electoral authority said that with 83% of the vote counted from Sunday's election, Morales was in first with 45.3%, followed by former President Carlos Mesa with 38.2% for second place in the field of nine candidates.

A special electoral mission from the Organization of American States said it was closely monitoring the election and requested information from the Supreme Electoral Tribunal after the transmission of preliminary results was halted.

If the results hold, Morales and Mesa will face off in a December ballot in which Morales could be vulnerable to a united opposition.

"We're in a runoff," Mesa told supporters shortly after the first results were announced. He said his coalition had scored "an unquestionable triumph," and called on others parties to join him for a "definitive triumph" in the second round.

Morales, 59, a native Aymara from Bolivia's highlands, came to prominence leading social protests and rose to power as the country' first indigenous president in 2006. Since then, he coasted to two re-election victories and presided over more than a decade of business-boosting economic growth in South America's poorest country. Following a boom in commodities prices, Morales paved roads, sent Bolivia's first satellite to space and curbed inflation. Stadiums, markets, schools, state enterprises and even a village bear his name.

Being forced into a runoff "is a sharp blow to Morales, whose political success has been impressive and who seemed confident of a first-round win," said Michael Shifter, head of the Inter-American Dialogue, a Washington-based think tank. "Morales' failure to achieve a first-round victory reflects growing concern about a slowing economy, corruption scandals and his determination to pursue a fourth term in defiance of a national referendum and the Bolivian constitution. Many Bolivians are simply weary. If re-elected, Evo will be in office nearly two decades."

Mesa is a 66-year-old historian who as vice president rose to Bolivia's top office when his predecessor resigned the presidency in 2003 amid widespread protests. Mesa then stepped aside himself in 2005 amid renewed demonstrations led by Morales, who was then leader of the coca growers union.

"In a second round the question will be if the opposition can unite behind one candidate," said Christopher Sabatini, a lecturer at the School of International and Public Affairs at Columbia University in New York and a senior research fellow at Chatham House. "In that case Evo may try to divide the opposition and use state resources to guarantee his victory."

To avoid a runoff and win outright in Bolivia, Morales would have needed to get 50% of the votes plus one or have 40% and finish 10 percentage points ahead of the nearest challenger.

Bolivians also elected all 166 congressional seats. Morales' Movement Toward Socialism party lost seats although it retained a majority in Congress.

Voting, which was mandatory, was mostly calm, though police said they arrested more than 100 people for violating the country's rigid election-day rules against drinking, large gatherings or casual driving.

Morales voted early in the coca-growing region of El Chapare, where residents threw flower petals at him and he said he remained confident of his chances.

In his years in office, he has allied himself with a leftist bloc of Latin American leaders and used revenues from the Andean country's natural gas and minerals to redistribute wealth among the masses and lift millions out of poverty. Surrounded by nations reeling from economic crises, Bolivia under Morales remains a rare example of stability and growth. The economy has grown by an annual average of about 4.5%, well above the regional average, and the International Monetary Fund predicts it will grow at 4% this year.

Morales, the son of Aymara Indian shepherds, has also been credited for battling racial inequalities.

Many Bolivians, such as vendor Celestino Aguirre still identify with "Evo," as he's widely known, saying people shouldn't criticize him so much. "It's not against Evo, it's against me, against the poor people, against the humble."

But Morales also has faced growing dissatisfaction even among his indigenous supporters. Some are frustrated by corruption scandals linked to his administration — though not Morales himself — and many by his refusal to accept a referendum on limiting presidential terms. While Bolivians voted to maintain term limits in 2016, the country's top court, which is seen by critics as friendly to the president, ruled that limits would violate Morales' political rights as a citizen.

"I'm thinking of a real change because I think that Evo Morales has done what he had to do and should leave by the front door," said Nicolás Choque, a car washer.

Follow NBC Latino on Facebook, Twitter and Instagram.