Updated

The Hungarian parliament chose a close ally of Prime Minister Viktor Orban to be country's new president Wednesday, guaranteeing that his conservative Fidesz party will be able to pass laws at will without interference.

Janos Ader, a European Parliament lawmaker, was elected to a five-year term by a vote of 262-40. Ader replaces Pal Schmitt, who resigned last month after Hungary's Semmelweis University stripped him of his doctoral degree over charges that he had plagiarized his 1992 thesis.

The choice is sure to fan increasing tensions between Budapest and the European Union. The EU and civil rights groups fear that Orban and Fidesz are engaged in a power grab that restricts basic freedoms and civil rights in Hungary, an EU member.

Ader fanned those fears, addressing parliament in a speech peppered with nationalist imagery after taking the oath of office Wednesday.

"I say to the people of the neighboring countries, and to our allies in the European Union and NATO, we offer them friendship and respect — which also means that we expect the same respect and friendship back," Ader said. "The homeland before all else!"

While Hungary's presidency is largely ceremonial, the head of state has the power to send bills back to Parliament for reconsideration or refer them to the Constitutional Court. Ader, an ally of Orban's for nearly a quarter century, is expected to follow his predecessor's example of signing into law every bill that crosses his desk.

"The main criteria for Ader's election was loyalty to the governing majority," said Orsolya Szomszed, an analyst at the Nezopont Institute in Budapest.

The Hungarian Socialist Party, the largest opposition formation in parliament, boycotted the presidential election.

"If we look at Janos Ader, his person fits all the criteria for party soldier," Socialist party president Attila Mesterhazy told The Associated Press.

Ader, 52, becomes Hungary's youngest president since the fall of communism in 1989. He is also the first president to take office under Hungary's new Constitution, which took effect Jan. 1.

Critics complain the new constitution erases checks and balances on state power — and Fidesz controls virtually all state power by virtue of its two-thirds majority in parliament. That proves problematic for a president who is supposed to serve as a check on the government, said Szabolcs Kerek-Barczy, managing director of the Freedom and Reform Institute, a Budapest-based conservative think tank.

"Nobody in this country can be a protector of the rule of law and checks and balances and comply with the current constitution at the same time," Kerek-Barczy told the AP.

Ader drafted the Orban administration's 2011 overhaul of the judiciary system, which the European Commission has referred to the European Court of Justice over concerns that it limits courts' independence. Ader is also the architect of Hungary's new election system, which the opposition parties say will tilt future elections in Fidesz's favor.

A lawyer by training, Ader entered parliament in 1990 and remained there until he moved to the European Parliament in 2009. He was Parliament speaker under the first Orban administration from 1998 to 2002 and led the Fidesz caucus in opposition from 2002 to 2006.