Mr. Correa was among 20 people, including his vice president, Jorge Glas, accused of accepting $8 million in bribes in exchange for public contracts from 2012 and 2016. The former president left Ecuador three years ago, and his conviction, which he can appeal, leaves him subject to arrest if he returns.

In addition to the prison term, the court banned Mr. Correa, 57, from politics for 25 years.

The trial was closely watched in Ecuador and the verdict is likely to affect not only a presidential election slated for next year, but also the political landscape for years to come. Mr. Correa denied the charges, describing them as a form of political persecution intended to prevent him and his allies from running in future national elections.

After leaving office in 2017, he moved to Belgium and vowed to retire from politics, but he has since reversed course. Saying that he felt compelled to “take the fatherland back,” Mr. Correa has expressed interest in running for office in 2021, which his conviction, if it stands, would prevent.

“Correa is, paradoxically, the most popular and the most rejected political figure in Ecuador,” the political analyst Rafael Balda said. His presence on the ballot would lift his political party, now known as Movimiento Revolución Ciudadana, but even his campaigning on its behalf would make a big difference, Mr. Balda said.

The case emerged from an investigation initially known as Arroz Verde, or Green Rice, after the name of the file found in an email sent to a former aide to Mr. Correa. The file, revealed by the online publication Mil Hojas, contained names, amounts and dates of payments made by several companies and individuals to the campaigns of his party, prosecutors said.