The High Court in Belfast intends to quash a decision to go ahead with a £330 million cross border dual carriageway project.
Mr Justice Stephens said he is minded to make the order over a failure to carry out an appropriate impact assessment on special areas of conservation around two rivers.
However, Northern Ireland's Department for Regional Development is to be given another chance to argue that the breach should not result in the decision to go ahead with the A5 being quashed.
The legal challenge was brought by a group of farmers, businessmen and landowners opposed to the project.
The road, between Derry and Aughnacloy, was to be part of a cross border route linking Dublin and the northwest.
Uncertainty surrounds the overall project after the Government reduced the funding it was making available due to the economic crisis in the Republic.
All other grounds of challenge advanced by a campaign group seeking to block the two stretches between Derry and Aughnacloy, Co Tyrone, were rejected.
Work on the 85km of dual carriageway has been put on hold due to the legal intervention.
Eighteen farmers, businessmen and landowners joined together under the Alternative A5 Alliance grouping in a legal challenge to the project announced in July last year.
Judicial review proceedings centred on the decision to press ahead with two sections of the route, for which the Stormont Executive has approved £280m (€320m).
Lawyers for the alliance claimed it has now become a different project, and that no proper environmental impact assessment (EIA) has been carried out.
In a 67-page judgment, Mr Justice Stephens dismissed this claim, along with others alleging apparent bias of the inspectors at the public inquiry and a breach of the group's property rights.
However, he found there had been a failure to carry out an appropriate assessment of the Rivers Foyle and Finn Special Areas of Conservation under the Habitats Directive.
The judge said Loughs Agency evidence to the public inquiry raised doubts over the effectiveness of remedial measures proposed by the department.
Lawyers on both sides will return to court next week for a final resolution to the case.
Costs of bringing the challenge will also be settled at that stage.