Court judges have thrown out plans by the Tories to deny legal aid to those who have not lived in Britain continuously for at least a year. The ruling was hailed as a victory by Public Law Project (PLP), a legal charity.

The Supreme Court has allowed an appeal by campaigners who are against the proposals for the legal aid residence test, which they say restricts access to justice for individuals born abroad in civil cases. Human rights campaigners were concerned that the proposals could have a very grim effect on migrants and their families who have recently arrived in the UK.

Three judges in the High Court heard how the move could have a detrimental impact on vulnerable people and initially ruled the plans were unjustifiably discriminatory. Michael Fordham QC, who appeared for PLP, argued that Lord Chancellor Michael Gove would be acting beyond his powers if he amended the Legal Aid, Sentencing and Punishment of Offenders Act 2012.

In a statement, the supreme court said: "The issues in this appeal were whether the proposed civil legal aid residence test in the draft Legal Aid, Sentencing and Punishment of Offenders Act (Amendment of Schedule 1) Order 2014 is ultra vires [beyond the powers of the legislation] and unjustifiably discriminatory and so in breach of common law and the Human Rights Act 1998.

"At the end of today's hearing the supreme court announced that it was allowing the appeal on ground [of ultra vires] ... The supreme court asked the parties whether they wished to address the court on the second issue. The case has been adjourned while this is considered."

John Halford, the solicitor from Bindmans law firm who represented the PLP, said in a Guardian report: "The British legal system is rooted in two fundamental principles – that all equally enjoy the protection of our laws and all are accountable to our courts.

"The lord chancellor takes an oath of office to honour these principles but planned to undermine them by withholding legal aid from those who failed his residence test, leaving them unable to enforce legal rights in the most compelling cases.

"Yet today, after minutes of deliberation, seven justices of our highest court held him accountable, ruling he was acting in a legal vacuum and without parliamentary authority. Rationing justice using a residence test was, and always will be, repugnant to British law."

Lawyers on behalf of the Conservative government argued that the UK has one of the most costly legal aid systems in the world and that the mooted changes were in order to save costs. A Ministry of Justice spokesman said: "We are of course very disappointed with this decision. We will now wait for the full written judgment to consider."