BUDAPEST, Hungary — Before a crowd of tens of thousands gathered on Kossuth Square, Péter Magyar took the oath of office on Saturday to become Hungary’s prime minister, formally ending Viktor Orbán’s 16-year hold on power. Magyar, a 45-year-old lawyer who founded the center-right Tisza party only two years ago, enters office with a commanding two-thirds parliamentary majority — the largest mandate any party has secured in post-Communist Hungarian history — and a promise to dismantle the autocratic infrastructure Orbán built. Addressing the crowd after the ceremony, Magyar declared that “every freedom-loving person in the world would like to be Hungarian a little,” and later, inside the neo-Gothic parliament building, called on all Fidesz-appointed heads of government institutions to resign by May 31.

The April election that swept Tisza to power was a stunning repudiation of Fidesz, which plummeted from 135 seats to just 52. Orbán, a fixture in Hungarian politics since the first post-Communist assembly in 1990, was absent from the chamber as the new lawmakers took their seats. The outgoing prime minister did not attend the inaugural session.

Magyar has made repairing relations with the European Union a top priority. After he took office, the EU flag was raised above the parliament building for the first time since Orbán’s government removed it in 2014. The new prime minister said he aims to unlock about 17 billion euros ($20 billion) in EU funds frozen over rule-of-law and corruption concerns — money Hungary’s stagnating economy urgently needs. He also promised to restore Hungary’s standing among Western democracies, which had eroded as Orbán drew closer to Russia.

Central to Magyar’s agenda is accounting for the Orbán era. He announced plans to create a National Asset Recovery and Protection Office to investigate and seek the return of public funds allegedly misused under the previous administration. The public broadcaster, long viewed as a Fidesz mouthpiece, will have its news services suspended until editorial independence can be guaranteed, he said. Standing before the National Assembly, Magyar told lawmakers that voters had “given us a mandate to open a new chapter in Hungary’s history.”

In his address to the crowd outside, the new prime minister struck a note of reconciliation. “You have taught the country and the world that it is the most ordinary, flesh-and-blood people that can defeat the most vicious tyranny,” he said to roaring applause. He told supporters that “Hungary is able to get back on its feet, is able to believe in itself and to once again be a common homeland for all Hungarians” — a direct contrast to the divisions that characterized Orbán’s tenure. Supporters waved Hungarian and European Union flags and wore Tisza T-shirts.

The new parliament also marked a historic shift for gender representation: 54 women won seats, the most in Hungary’s history, nearly all from Tisza. Andrea Szepesi, a newly elected economist from Budapest, told The Associated Press it was “about time” that women held more seats, noting that under Orbán, Hungary had fewer women in government than almost any other EU nation. “Finally, women are able to participate in this new, beautiful democratic system and the flourishing of the country,” she said.

Áron Farsang, a 27-year-old web designer attending the celebration, said he expects the government to reduce Russian influence, including energy dependency and “their general political style.” “I would also really like it if we could get rid of the Russian influence as soon as possible,” he told the AP.

The transformation of Hungary’s political landscape is expected to alter dynamics within the EU, where Orbán frequently vetoed key decisions, most recently on support for Ukraine. With Magyar in power, Hungary is poised to rejoin the European mainstream after years as the bloc’s most prominent dissenter.