Tens of thousands rallied on Sunday in Hungary's capital, Budapest, in protest of a law that could force a university founded by George Soros, a Hungarian-born American billionaire, to move out of the country.

A bill passed in parliament this week by the ruling right-wing Fidesz party of Prime Minister Viktor Orban, a critic of liberal civil organisations funded by Soros, sets new conditions for foreign universities operating in Hungary.

Some of the requirements, such as carrying out teaching activities in their home countries, are seen specifically targeting the Central European University (CEU), which was set up by Soros in 1991.

The new rules bar institutions based outside the European Union from awarding Hungarian diplomas without a binding agreement between national governments. Universities will also be required to have a campus and faculties in their home country - although registered in the United States, the CEU does not have a campus there.

The bill still has to be signed into law by President Janos Ader.

OPINION: Why is Hungary trying to shut down a university?

Protesters filling Kossuth Square outside parliament said they want Ader, from Orban's party, to veto the legislation. Organisers said up to 80,000 people took part in the rally, making it the largest anti-government protest in years.

"Don't sign it, Jani," the crowd shouted, using a Hungarian nickname for Ader's first name. Other chants included "A free country, a free university", ''Orban get out", ''Viktator!" and "Europe, Europe".

Daniel Berg, a CEU student, told the crowd: "There are moments in the career of every politician when they have a chance to prove that they are public servants, that they are not just foot soldiers of their party but statesmen ... The country where the government closes schools cannot succeed."

The English-language CEU has 1,800 students from 100 countries and is ranked in the top 50 universities for political and international studies in the World University Rankings list.

"These people at the top, they don't realise that we don't live in Russia, but in Hungary!" a protester, 23-year-old IT expert Viktor Szakal, told the AFP news agency.

"We have to show strength with our numbers. I'm glad that so many people showed up. Orban understands only the rules of power, and our power comes from our numbers."

Government spokesman Zoltan Kovacs denied in a blog post on Thursday that the CEU was being singled out, saying that irregularities had been found with 27 foreign higher education institutions.

"It's noteworthy that all of the other institutions have accepted this modest minimal condition of university equality and fairness. Only CEU has protested because the university insists on its unfair privileges," Kovacs said.

The legislation has attracted widespread criticism abroad, including from Washington, Brussels and university professors - more than 900 academics around the world, including 18 Nobel prize-winning economists, have signed an open letter calling for the proposal to be withdrawn.

OPINION: Hungary should be kicked out of the EU

Critics see the move as another attack by Orban on Soros, whom he accuses of seeking to meddle in politics and undermine Europe by promoting immigration into Europe.

Orban has alleged that non-governmental organisations (NGOs) supported by Soros, including corruption watchdog, Transparency International, and rights advocate, Hungarian Helsinki Committee, are "foreign agents" working against Hungarian interests.

A law expected to be passed in May would force NGOs getting more than 7.2 million forints ($24,500) a year from abroad to register with authorities.