The Supreme Court is deciding on the legality of proposed "residence test" restrictions on foreign-born individuals obtaining legal aid in civil court cases.
The issue has reached the highest court in the land after splitting the judiciary in the lower courts.
After hearing how the move could impact on vulnerable people, three judges in the High Court ruled the test ultra vires - or beyond legal authority - and unjustifiably discriminatory.
But the Court of Appeal, composed of three different judges, declared in November that the lord chancellor did have power to introduce the test by way of secondary legislation, and that while withholding legal aid from particular groups might be discriminatory, it could be justified.
Now a panel of seven Supreme Court justices headed by the president, Lord Neuberger, is hearing two days of argument before giving a definitive ruling.
The lord chancellor wants to introduce the test through secondary legislation in the form of an amendment to the Legal Aid, Sentencing and Punishment of Offenders Act 2012 (LASPO).
Government lawyers argue the country has one of the most expensive legal aid systems in the world and the move is necessary to save costs and restore public confidence in the system amid public concern over the expense.
The test will, with certain exceptions, restrict civic legal aid to people who have lived in the UK, Crown dependencies or British overseas territories continuously for a period of at least 12 months at the time of applying for aid.
Human rights campaigners say it will have a particularly serious impact on recently arrived migrants and their children.
One of the cases used to highlight the issue in the High Court was that of P, an adult with severe learning disabilities forced to live in a dog kennel by his family, subjected to regular beatings by his brother and mother, and starved over an extensive period of time.
Ruling against the test, Lord Justice Moses said: ''With the benefit of legal aid and the involvement of the Official Solicitor, proceedings in the Court of Protection resulted in a determination that it was in P's best interests to live separately from his family in a small group home with his friends and peers and 24-hour care.''
If the residency test had been in place at the time, it would have been impossible to discover whether he met it and was entitled to legal assistance from the state, said the judge.
The legal charity Public Law Project (PLP), represented by law firm Bindmans, is asking the Supreme Court to uphold the High Court ruling and overturn the appeal court decision that the test is lawful.
Michael Fordham QC, appearing for PLP, argued that the lord chancellor was acting beyond his powers and targeting a vulnerable group - "notwithstanding their equal rights and their equal needs".
John Halford of Bindmans said in a press statement that PLP wanted the Supreme Court judges - Lord Neuberger sitting with Lady Hale, Lord Mance, Lord Reed, Lord Carnwath, Lord Hughes and Lord Toulson - to rule the test "repugnant to British law".
He said: "In this country, we are rightly proud we have a legal system which, whilst not perfect, seeks to ensure that anyone can enforce important legal rights and enter into the courtroom on an equal footing to their opponents.
"Legal aid has been available to facilitate this in its current form for over 60 years.
"The lord chancellor's proposed residence test strikes at the heart of these principles by very deliberately withholding legal aid from those who overwhelmingly will not be British, yet are obliged to obey the law here and so should, equally, be protected by it."
A Ministry of Justice (MoJ) spokesman defended the fairness of the test, saying: "This government believes that, in principle, individuals should have a strong connection to the UK in order to benefit from the civil legal aid scheme.
"We believe the residence test proposed during the previous Parliament is a fair and appropriate way to demonstrate that connection."
It is understood the MoJ aims to have regulations to introduce the test in place this spring, ready to come into force in the summer, unless the Supreme Court intervenes.