Image copyright Reuters Image caption There were street protests in Budapest against the threat to the university

A university in Hungary under threat of being shut down says an agreement with the government seems to be approaching.

The Central European University in Budapest has accused the government of trying to remove it from the country - prompting an international campaign to protect academic freedom.

There have been negotiations in New York and the university says a "basis for an agreement" has been reached.

It says it is waiting for Hungary's government to give its approval.

The university, founded by the liberal philanthropist George Soros, has been at the centre of a symbolic dispute with the nationalist government of Viktor Orban.

'Line in the sand'

There were warnings from the university that it was going to be stopped from teaching.

But the government had said that the CEU only needed to comply with the country's new higher education regulations.

The university has accreditation in the United States - and the governor of New York state, Andrew Cuomo, hosted talks to end the stand-off.

Although university representatives were not part of the negotiations, a statement from CEU says a memorandum of understanding has been signed, in a deal involving another US college.

The international university says it is waiting for the signature of the Hungarian government, which would confirm that it can stay in Budapest.

Image caption The Hungarian government is running a "national consultation" over George Soros

As well as Hungary's prime minister, the university dispute has embroiled other European leaders, the European Parliament, international university heads and the US government.

CEU president Michael Ignatieff described it as a "line in the sand" and said it would have been the first time since World War Two that a European democracy had forced a university to close.

Hungary's leader had been a vocal supporter of US President Donald Trump before he was elected.

But as the dispute developed, the US government backed the CEU university, accusing Hungary's government of imposing "discriminatory, onerous requirements on US-accredited institutions in Hungary".

Hungary's government has said that it has been misrepresented and that the CEU has been seeking privileges not available to other Hungarian universities.

The government has continued its criticism of George Soros with a "national consultation" over what is claimed as his support for mass migration.

This has seen adverts on billboards and television and letters sent to households.

But the European Union has said that it is pursuing legal action against Hungary over its pressure on foreign-backed civil society groups and NGOs, which it is claimed has targeted projects backed by Mr Soros.