The European Commission says that a law in Hungary that criminalizes asylum seekers is illegal in violation of the country over EU migration.
Hungary has now been referred to the ECJ for "non-compliance" with EU legislation.
Viktor Orban's government adopted a law in June saying that someone "facilitates illegal immigration" could face imprisonment.
The law was called "Stop Soros" after the billionaire philanthropy Hungary accuses of supporting Muslim immigrants.
On Thursday, the Commission condemned Hungary over the law, as it said restricted asylum seekers' right to turn to national, international and non-governmental organizations for assistance.
An infringement procedure was considered open to the country because the new legislation violated EU rules and allowed a "formal notification" to be issued.
The Commission has accused Hungary of not respecting EU law when returning asylum seekers to other countries or detaining them at the border with Serbia.
"The Commission considers that uninterrupted detention of asylum seekers in transit zones without respecting the applicable procedural guarantees is contrary to EU rules" in a statement.
Last month, a report from the Venice Council Commission, which leaked to the BBC, highlighted concerns about the new Hungarian law and noted that the legislation "criminalizes organizational activities that are not directly related to the materialization of illegal migration."
The Hungarian government argues that it makes the rest of Europe a service by limiting the flow of what it considers illegal immigrants in the blood c.
Hungary has also said that immigration threatens its national security but its tough attitude has been achieved with widespread international criticism.
Hungarian-American Businessman George Soros is one of the world's most famous and philanthropic financial investors
At the height of Europe's refugee crisis, Soros promised generous support to support groups that support immigrants.
Why is the law controversial?
The Act has amended eight existing laws and introduced the new crime to "facilitate illegal immigration."
Under the new law, everybody could be detained for work for or with NGOs involved in helping or fighting for asylum seekers. Human rights groups insist that all they are trying to do is help people who have entered Hungary to seek legal asylum.
The measures also tighten restrictions on asylum so that everyone tries to enter Hungary from a third country where they are not directly threatened with persecution can not claim protection.
When around 400 people traveled through Hungary in the midst of the migrant crisis in 201
The Commission imposed a mandatory asylum quota for each EU state in response to the crisis, but Orban refused to accept Hungary.
In 2015, 177,000 people sought asylum in Hungary, but only a few hundred were accepted. Last year, the number of asylum applications fell to approximately 3,200.