Bolivia’s government electoral tribunal on Thursday declared President Evo Morales outright winner in the election for a fourth term in office after a controversial vote count that sparked protests across the South American nation.

Opposition leaders, meanwhile, accused Morales of election fraud and called for more demonstrations to demand a second round of voting. Morales has warned of a “coup attempt.”

Tensions continued to escalate in the Andean nation of 11 million, which this week became the latest in Latin America to erupt in violent anti-government demonstrations. Protesters burned and looted election offices Monday night after the socialist president emerged from an unexplained gap in the publication of election results in better shape than he entered it.

The elections tribunal Thursday showed Morales obtained more than the 10 percentage-point lead needed to avoid a runoff election in December. With 99 percent of the votes from Sunday’s election counted, Morales is at 47.07 percent; his main rival, former president Carlos Mesa, is at 36.5 percent, the tribunal said.

But that was after an unexplained gap in results for nearly 24 hours Sunday and Monday. Preliminary returns after the polls closed Sunday evening suggested the race was headed for a runoff, which analysts said Morales had a strong chance of losing. The next numbers, published Monday evening, showed the tally had swung in his favor.

Protesters in La Paz and other cities set fires, looted offices and tore down a statue of the late Venezuelan president Hugo Chávez, a Morales ally.

Morales, generally popular in Bolivia after 13 years but less so than in the past, celebrated victory Thursday. “Good news,” he said at a morning news conference. “We already won the first round.”

He had warned the night before of a coup attempt led by “the right,” in coordination with foreign powers: “We have confronted it without violence, but I have to say, we are in a state of emergency to defend democracy.”

Mesa, who has united opposition parties from the right and the left against Morales, called the accusation “incredible” and accused Morales of “maneuvering a massive fraud.”

“If there is someone that systematically violates and breaks the constitutional rule of law, it’s Evo Morales,” said Mesa, who was president from 2003 to 2005. “He controls and gives orders to all the powers of the state.”

Mesa warned supporters that he risked jail for “false accusations” of instigating violence. He called for nationwide “permanent mobilizations.”

The Coordinator for the Defense of Democracy, a committee formed Wednesday by Mesa, other opposition leaders and civil society groups, called for “peaceful protests” until the government agrees to go to a second round of voting.

The chief elections observer for the Organization of American States said Wednesday that Bolivian authorities had no valid explanation for the gap in publishing vote counts. The OAS, which met in Washington on Wednesday to discuss the election, has called the gap “surprising” and “worrying.”

Gerardo de Icaza, the OAS director of electoral observation and cooperation, said the election should go to a second round, no matter the results of the first.

“Given the context and the evidenced problems in this electoral process, it would still be a better option to go to a second round,” he said. On Thursday, the European Union agreed.

Carlos Trujillo, the U.S. representative to the OAS, said the United States “soundly rejects the Electoral Tribunal’s ongoing attempts to subvert Bolivian democracy by delaying the vote count and taking actions that undermine the credibility of Bolivia’s elections.”

“Now that President Morales and his party know their own unpopularity, they will cheat to win,” Trujillo said. “If he is as popular as he claims, he will win in the second round.”

Morales drew support from fellow Latin American leftists.

“The Bolivian people will overcome the violence of this attempt by sectors of the right, which want to destroy Bolivian democracy, destroy President Evo Morales and violate the reality of the constitution and laws,” Venezuelan President Nicolás Maduro said in a televised address Wednesday.

“The left continues in the Latin American political map,” Cuban President Miguel Díaz-Canel tweeted. “Despite the media war of the continental right, Evo won for the fourth time. Congratulations brother.”

Morales, Bolivia’s first indigenous president, is credited with bringing significant economic growth and reducing poverty and inequality in one of the region’s poorest countries. He also has been accused of weakening democracy and concentrating power.

The fact that he was running for a fourth term was controversial: After losing a referendum in 2016 that would have allowed him to sidestep term limits, he secured a court ruling that enabled him to run again anyway.

“There’s certainty ‘Evo fatigue’ in the country, and protests are a real threat to Morales,” said Raúl L. Madrid, a University of Texas political scientist who studies indigenous and leftist politics in Latin America. “Bolivia is not Venezuela, which is clearly authoritarian. It has been teetering on the edge for a while, and I think it would be very costly for Morales to lose respect from the international community by stealing these elections.”