A center-right alliance led by the Social Democratic Party has won Portugal’s general election by a slender margin and is set to form a minority government that could have a difficult term in office as a radical-right populist party that came third in the voting tries to get a hand on the levers of power.

Results published late Wednesday after votes from abroad were counted to decide the last four lawmakers from the March 10 balloting gave the Democratic Alliance a final tally of 80 seats in the 230-seat National Assembly, Portugal’s parliament.

The center-left Socialist Party placed second with 78 seats and has said it won’t stand in the way of the Democratic Alliance forming a minority government in an upcoming parliamentary vote.

PORTUGAL'S ELECTION SEES SURGE IN SUPPORT FOR POPULIST PARTY AS EUROPE LEANS RIGHT

The hard-right Chega (Enough) party collected 50 seats, up from 12 seats in a 2022 election, in a staggering surge that upends traditional politics in Portugal, where the Social Democrats and Socialists have alternated in power for decades.

Chega leader Andre Ventura is demanding that the Social Democrats give his party a say in governing the country, either through granting it seats in the Cabinet or through a parliamentary alliance.

Luis Montenegro arrives in Lisbon

Luis Montenegro, leader of the center-right Democratic Alliance coalition, left, arrives at the Belem presidential palace to be received by Portuguese President Marcelo Rebelo de Sousa, for consultations following Portugal's general election results, in Lisbon, Wednesday, March 20, 2024. Rebels de Sousa is expected to ask Montenegro to form a government after having heard the leaders of all parties in parliament. At right is secretary general of PSD party Hugo and center Nuno Melo, leader of the PP party, two members of the Democratic Alliance coalition. (AP Photo/Armando Franca)

Final official results will be certified on Friday. By law, the parties have 48 hours to present legal challenges to the outcome.

President Marcelo Rebelo de Sousa, as head of state, invited Luis Montenegro, head of the Democratic Alliance and Social Democrat leader, to form a government at a meeting held after midnight.

Montenegro and his government are due to take office on April 2. The government then presents its policy proposals to Parliament, where other parties can bring a vote of no confidence. If that motion is successful, another party leader is invited to try to form a government, or another election is held.

Montenegro, the incoming prime minister, has so far ruled out any deal with the populists, many of whose policies are unpalatable for many Portuguese. But his hand could be forced by political circumstances because his minority government won’t be able to push through legislation on its own.

Ventura, the populist leader, has threatened to make life difficult for the new government in key votes, such as the state budget, unless Montenegro yields to his demands.

Ventura has made common cause with other radical-right parties across Europe. He has built ties with Matteo Salvini, Italy’s deputy prime minister and head of the populist, right-wing League party, French far-right leader Marine Le Pen and the leader of neighboring Spain’s far-right Vox party, Santiago Abascal.

Ventura says he is prepared to drop some of his party’s most controversial proposals -– such as chemical castration for some sex offenders and the introduction of life prison sentences — if that opens the door to power.

A slew of recent corruption scandals tarnished the Socialists and Social Democrats, and Chega ran under an anti-graft banner.

CLICK HERE TO GET THE FOX NEWS APP

Low wages and a high cost of living — worsened last year by surges in inflation and interest rates — along with a housing crisis and failings in public health care contributed to a mood of disaffection with mainstream parties.