Denying the unmarried mother of four children a widowed parent’s allowance is illegal, the supreme court has ruled, in a decision that significantly extends the rights of unmarried couples.

By a majority of four to one, the court’s justices declared the government’s refusal to pay up to £117 a week in benefits breached the family’s human rights. It will put pressure on ministers to consider making urgent changes to the law.

The judgment follows a hearing earlier this year in Belfast where the court was told that withholding the allowance from Siobhan McLaughlin amounted to discrimination against all children born out of wedlock.

The special needs classroom assistant, 46, from Armoy, in County Antrim, has four children: Rebecca, 15, Billy, 16, Lisa, 21, and Stuart, 23. Her partner, John Adams, a former groundsman, died from cancer in January 2014. She was refused a bereavement payment and widowed parent’s allowance because they were neither married nor in a civil partnership.

The ruling comes at a time when the rights of unmarried couples are rising up the political agenda. In 1996 there were 1.5 million cohabiting partners in the UK; by 2017, the figure had risen to 3.3 million. Many mistakenly believe they have the same legal and financial rights and protections as married couples.

Although the ruling relates to a Northern Ireland case, the decision will affect the rest of the UK. It could affect tens of thousands of couples.

According to a report by the House of Commons work and pensions committee two years ago, extending the widowed parent’s allowance to cohabitants would cost about £26m a year.

Delivering the majority decision, Lady Hale said: “It is difficult indeed to see the justification for denying people and their children benefits, or paying them at a lower rate of benefit, simply because the adults are not married to one another. Their needs, and more importantly their children’s needs, are the same.

“… Is it a proportionate means of achieving the legitimate aim of privileging marriage to deny Ms McLaughlin and her children the benefit of Mr Adams’ contributions because they were not married to one another? In my view, the answer is manifestly ‘no’, at least on the facts of this case.”

That view was consistent, Hale added, with the UK’s obligations under article three of the United Nations convention on the rights of the child which states: “In all actions concerning children … the best interests of the child shall be a primary consideration.”

The judgment also notes that a “great majority of member states” within the Council of Europe provide survivor’s pensions directly to the children irrespective of whether their parents were married or not.

In another section of the ruling, Lord Mance said a judgment in 2000 by the European court of human rights, in the case of Shackell v the UK which denied a widow her benefits, had failed to address the interests of any children in a partnership.

Responding to the ruling, the Department for Work and Pensions said: “We will consider the court’s ruling carefully. Widowed parent’s allowance was a contributory benefit, and it has always been the case that inheritable benefits derived from another person’s contributions should be based on the concept of legal marriage or civil partnership.

“This ruling doesn’t change the current eligibility rules for receiving bereavement benefits, which are paid only to people who are married or in a civil partnership.”

McLaughlin, who had to take an evening job after being refused the allowance, said after the ruling: “For me, this case was always about the rights of bereaved children. I am so delighted that the supreme court shared our view that the law as it stands has discriminated against my children.

“I hope that my taking and succeeding with this challenge gives others both confidence and courage to continue to challenge the unfairness and inequalities in our laws in Northern Ireland and throughout the UK.”

She said her experience had been an “emotional rollercoaster”, adding: “I have cried, I have beamed with joy, I have cried more, it’s been surreal. I am really happy.”

Georgia Elms, a spokesperson for the charity Way (Widowed and Young), said: “Considering that cohabiting-couple families are the fastest growing family type in the UK, the current system is fundamentally flawed and unfit for purpose.

“As such, we hope that the ruling will set a precedent that drives the necessary changes to the current law so that unmarried couples and their children are not denied support simply because of their marital status – especially considering cohabiting couples will have paid into the National Insurance pot from which this money is drawn.”

Alison Penny, the director of the Childhood Bereavement Network, said: “We estimate that every year over 2,000 families like Siobhan’s face the double hit of one parent dying and the other parent realising that they and the children are not eligible for bereavement benefits.

“Widowed parent’s allowance was replaced in April 2017 with bereavement support payment, but cohabiting parents are still ineligible for this new benefit.

“Each day that parliament delays, another five grieving parents and their children will fall foul of this injustice.”

Jo Edwards, a partner and head of family law at the London firm Forsters LLP, saidthe ruling was a victory for common sense.

“Lady Hale rightly questions the justification for denying people and their children benefits, or paying them at a lower rate, simply because the adults weren’t married to one another.

“In making this ruling, which could affect tens of thousands of cohabiting couples with dependent children … the supreme court is effectively requiring government to revisit its policy and decide whether, and if so, how, the law should be changed.”

Margaret Heathcote, the chair of the family justice organisation Resolution, said: “Cohabiting relationships are the fastest growing type of family, with recent estimates that one in eight adults in England and Wales are living together unmarried. However, an unmarried couple’s legal rights when their relationship unfortunately ends or one of them dies are complex and widely misunderstood.”