The High Court has declared unconstitutional a new law which was enacted by the Government to control the movements of non-nationals.
The decision will have major implications for how gardaí deal with immigrants.
Ms Justice Finlay Geoghegan found that Section 2.1 of the Immigration Act 1999 was not enacted within the framework for enacting laws as set out in the Constitution.
She also declared unconstitutional the provisions of the Aliens Order 1946 under which conditions may be placed by an immigration officer on aliens arriving here and provisions under which aliens are required to produce registration certificates, passports and other documents on demand from a Garda or immigration officer.
Following her ruling, the judge granted an order restraining the prosecution of a Chinese man for failing to produce identification to a Garda when requested to do so last May. He was detained in Cloverhill Prison on that charge.
She also granted an order quashing the prosecution of a Latvian woman who was charged with remaining within the State in contravention of the Aliens Order 1946 as provided for by Section 2 of the Immigration Act 1999.
The Minister for Justice, Mr McDowell, said this afternoon he would study the ruling in detail before commenting.