The Supreme Court in a 5-4 decision on Friday overturned Roe v. Wade, the landmark ruling that established the constitutional right to abortion in the U.S. in 1973.

The court’s controversial but expected ruling gives individual states the power to set their own abortion laws without concern of running afoul of Roe, which had permitted abortions during the first two trimesters of pregnancy.

Almost half the states are expected to outlaw or severely restrict abortion as a result of the Supreme Court’s decision, which is related to a highly restrictive new Mississippi abortion law. The laws will affect tens of millions of people around the country, who may have to cross state lines to seek reproductive health care.

Other states plan to maintain more liberal rules governing the termination of pregnancies.

Supporters of abortion rights immediately condemned the ruling, while abortion opponents praised a decision they had long hoped for and worked to ensure. Protesters descended on the Supreme Court on Friday to speak out both for and against a decision that will upend decades of precedent in the U.S.

The decision came a day after the Supreme Court in another controversial ruling invalidated a century-old New York law that had made it very difficult for people to obtain a license to carry a gun outside of their homes.