Central European University has announced it will leave Budapest for Vienna next year after a protracted legal and rhetorical battle with the Hungarian government, in what is the first case of a major university being pushed out of an EU country.

The university, which teaches in English and is regarded as one of the best in the region, has been in the crosshairs of the government of Hungary’s far-right prime minister, Viktor Orbán, for the past two years, in part because of its affiliation with George Soros, who founded it and is still on the board.

“This is a dark day for freedom in Hungary, and it’s a dark day for academic freedom,” said CEU’s rector, Michael Ignatieff, a Canadian former politician, at a press conference in Budapest on Monday.

CEU had given the Hungarian government until 1 December to sign an agreement that would give it a legal basis to operate in Hungary. Despite international pressure and the intervention of the US ambassador, the government made it clear it would not sign.

Orbán’s government, which won a third consecutive term in office in April elections, has presided over a crackdown on independent media and has been accused of a series of rule of law and corruption violations. Many of Orbán’s foreign backers in the European People’s party (EPP) had referred to CEU’s closure as a red line but with European elections approaching they are unlikely to speak out.

Viktor Orbán, the Hungarian prime minister. Photograph: Martin Divíšek/EPA

Chasing CEU out of Hungary marked the start of a new era for Orbán, said Liviu Matei, CEU’s provost. “A line has been crossed. People are being forced out of the country. This is not restriction any more, this is repression. In Hungary, the reign of repression has been started.”

The Hungarian government has painted the campaign against the university as purely legalistic, saying it is unfair that CEU issues US degrees but has no US campus. In response, CEU set up a campus at Bard College in New York.

“We complied, but the government of Hungary refuses to accept the word of the state of New York, it negotiated with the state of New York for three months and then walked away,” said Ignatieff.

Orbán’s government has campaigned on an aggressive anti-immigration platform, building a fence along its southern border, putting a 25% tax on organisations who help refugees, and repeatedly claiming that “Christian Europe” is under threat from migration. Orbán has made Soros, a Hungarian-born American financier, one of his main political targets, accusing him of pushing for open borders. The Hungarian parliament has enacted legislation known as the Stop Soros laws.

Zoltán Kovács, Orbán’s secretary of state for international communications, tweeted on Monday: “The Soros university is leaving but staying. It’s common knowledge that a significant number of its courses will still be held in Budapest. This is nothing more than a Soros-style political bluff, which does not merit the attention of the government.”

Ignatieff said some Hungarian-accredited courses would still be taught in Budapest, but these account for less than one-fifth of CEU’s degrees. New students beginning classes at CEU in 2019 will start in Vienna. Ignatieff said CEU would not become a “university in exile” and would devote itself to full integration in Austrian academic life, describing Austria as “a country where the rule of law and respect for free institutions still means something”.