Hungarian Prime Minister Viktor Orban has said the "real battle is just beginning", vowing to continue fighting against the European Union's migrant relocation plan despite suffering a setback at the bloc's top court.

Orban's remarks on Friday came two days after the European Court of Justice (ECJ) threw out the case from Hungary and Slovakia against the EU's quota scheme to spread up to 160,000 Syrian, Iraqi and Eritrean asylum seekers among the 28 member states.

"Hungary is a European Union member, so the bloc's treaties must be respected and the court's rulings must be acknowledged," the populist leader said in a radio interview.

"But this is not a reason to change an immigration policy that rejects migrants," he added.

"The court's ruling does not require Hungary to do anything", Orban said, because it focused only on whether the EU had the legal right to enforce refugee quotas.

He said EU countries which let in migrants, unlike Hungary, decided to do so of their own will and now they cannot ask Budapest to take a part in correcting their mistake.

"It is not us Hungarians who question the rules of the club, but the Commission had changed the rules and this is unacceptable," Orban said.

The "real battle [against Brussels] is just beginning," he added.

"The whole issue raises a very serious question of principles: whether we are an alliance of European free nations with the Commission representing our joint interests, or a European empire which has its centre in Brussels and which can issue orders."

READ MORE: Rejected asylum - From Karachi to Germany and back again

On Wednesday, the Luxembourg-based ECJ rejected a complaint filed by Hungary and Slovakia, reaffirming the bloc's right to order individual countries to accept refugees as part of a scheme drawn up in a bid to resettle arriving refugees more equally across the EU.

Under the scheme, Hungary is required to take in 1,294 refugees and Slovakia 902.

The court's decision is final and not open to appeal. As a result, European officials will continue to be able to order member state governments to take in specific quotas of refugees entering the bloc. Countries refusing to abide by the programme risk facing fines.

Refund request

Describing immigration as "poison", Orban has been at the forefront of a rebellion in eastern and central Europe against the quotas.

At the height of the migrant crisis, Budapest erected fences on its southern borders and recruited 3,000 "border hunter" police to patrol the frontiers.

The tough measures, which were denounced by Brussels and human rights groups, slowed the influx of refugees to a trickle until the so-called "Balkan Route" was effectively closed in March 2016.

In July 2016, Human Rights Watch released a report criticising Hungary's treatment of refugees and migrants detained after entering or while attempting to enter its territory, accusing the country's authorities of "breaking all the rules for asylum seekers".

READ MORE: UN urges EU not to send asylum seekers back to Hungary

Last month, Orban asked the EU to refund half the 800 million euros ($950m) Hungary says it has spent on the borders.

But European Commission President Jean-Claude Juncker chided Hungary this week for demanding extra money while refusing to participate in the relocation scheme.

Orban on Thursday sharply criticised Juncker's response, saying that forcing Hungary to accept immigrants amounted to "violence".

In July, the EU Commission threatened the Czech Republic, Hungary and Poland with lawsuits for not implementing the relocation measures.

Hungary and Poland remain the only EU states that "have not relocated a single person", while the Czech Republic has not relocated anyone since August 2016, the Commission said.