Millions of women in the US will lose their right the legal right to abortion, after the Supreme Court overturned a ruling that legalised it nationwide.

Justice Alito, in the final opinion issued on Friday, wrote that Roe and Planned Parenthood v Casey, the 1992 decision that reaffirmed the right to abortion, was wrong the day it was decided and must be overturned.

“We hold that Roe and Casey must be overruled. The Constitution makes no reference to abortion, and no such right is implicitly protected by any constitutional provision,” Justice Alito wrote.

Authority to regulate abortion rests with the political branches, not the courts, he wrote.

Joining Justice Alito were Justices Clarence Thomas, Neil Gorsuch, Brett Kavanaugh and Amy Coney Barrett. The latter three justices are Trump appointees.

What is Roe v Wade?

Roe v Wade is about the case of Norma McCorvey - known by the legal pseudonym 'Jane Roe' - who became pregnant with her third child in 1969.

She wanted an abortion but this was a problem as she lived in the state of Texas, which banned abortion except in the case if it was needed to save the life of the mother.

McCorvey's attorneys filed a lawsuit on her behalf in U.S. federal court against her local district attorney, Henry Wade, alleging that Texas's abortion laws were unconstitutional.

Her case was heard by the U.S. District Court for the Northern District of Texas, who ruled in her favour, which was then appealed to the Supreme Court by the state itself.

In the end, the Supreme Court ruled 7-2 in favour of McCorvey in January 1973 to protect women's rights to have an abortion, with the caveat that this right is not absolute and must be balanced against governments' interests in protecting women's health and prenatal life.

A balancing test was introduced, with governments not being able to prevent abortions in the first trimester of pregnancy.

Until now, the court has allowed states to regulate but not ban abortion before the point of viability, around 24 weeks.