In a wide-reaching decision, the U.S. Supreme Court has declared that same-sex "marriage" is a constitutional right and that states must recognize same-sex unions.

By a vote of 5-4, the court ruled June 26 that states must recognize same-sex "marriages" under the 14th Amendment, and recognize such unions contracted in other states.

Justice Anthony Kennedy, writing the majority opinion, said the court now holds that same-sex couples may "exercise the fundamental right to marry." He characterized this as a liberty that had been denied to them.

Chief Justice John Roberts and Justices Antonin Scalia, Clarence Thomas and Samuel A. Alito dissented and, in an unusual step, each wrote separate opinions.

"The majority's decision is an act of will, not legal judgment," Roberts said. "The right it announces has no basis in the Constitution or this court's precedent."

"Five lawyers have closed the debate and enacted their own vision of marriage as a matter of constitutional law," he said.

Justice Antonin Scalia characterized the decision as a "threat to American democracy," "hubris" and a "judicial putsch."

Justice Thomas said the decision means that conflict between the recognition of same-sex marriage and religious liberty appears "all but inevitable" as individuals and churches face demands to participate and endorse in these marriages. The use of the judicial process "short circuits" the political process that could consider religious freedom implications, "with potentially ruinous consequences for religious liberty."

Similarly, Justice Alito said the decision "will be used to vilify Americans who are unwilling to assent to the new orthodoxy." He objected to the majority's comparison of traditional marriage laws to laws that denied equal treatment for African-Americans and women, saying this analogy's implications "will be fully exploited by those who are determined to stamp out every vestige of dissent."

The decision in Obergefell v. Hodges dealt with claims that Ohio's marriage law discriminated by not recognizing same-sex unions contracted as marriages in other states. Several other states were also facing similar cases on the constitutionality of state marriage laws.

Backers of marriage as a union of one man and one woman argued that marriage is intrinsically connected to the procreation of children and cannot be redefined. Some also said the matter should be left to the people and the states and not decided in court when so much disagreement on the matter persists.

Backers of "gay marriage" asserted a fundamental right to marry whomever one loves, saying that failure to redefine marriage amounts to decimation.

Justice Kennedy's decision claimed that it "demeans gays and lesbians for the State to lock them out of a central institution of the Nation's society."

"Same-sex couples, too, may aspire to the transcendent purpose of marriage and seek fulfillment in its highest meaning."

Chief Justice Roberts said that a fundamental right to marry "does not include a right to make a state change its definition of marriage" and a decision to maintain marriage as a union of a man and a woman "can hardly be called irrational."

For his part, Justice Alito noted that the connection between marriage and procreation has eroded in the popular mind. However, he said it is "far beyond the outer reaches of this court's authority to say that a state may not adhere to the understanding of marriage that has long prevailed."

Justice Thomas objected to the majority decision's use of the legal principle of substantive due process, saying the court was "wiping out with a stroke of the keyboard the results of the political process in over 30 states." The decision was an "inversion of the original meaning of liberty."

Same-sex "marriage" was not firmly established in any U.S. state until 2004, after a Massachusetts court ruled that the state must give marriage licenses to same-sex couples.

In response to that ruling, some had called for a federal constitutional amendment to protect the definition of marriage. Voters in 30 states have passed constitutional amendments and referenda strengthening the legal definition of marriage as a union of one man and one woman. Many of these efforts have been overturned in state or federal court challenges.

In 2013, the Supreme Court dismissed an appeal from supporters of California's defense-of-marriage amendment, Proposition 8, which California officials had refused to defend in court. The Supreme Court said that the appeal did not have legal standing and allowed a lower state court's overruling of the proposition to take effect.

The Supreme Court itself has declined to review several recent appeals seeking to defend state marriage laws against lower court decisions.

Also in 2013, a 5-4 ruling from the Supreme Court struck down aspects of the 1996 federal Defense of Marriage Act. The court claimed that a provision defining marriage as a union of one man and one woman for federal purposes violated the U.S. constitution's equal protection guarantees. The ruling said that the federal government must recognize "gay marriages" in individual states if the states choose to recognize them.

The Defense of Marriage Act had passed Congress overwhelmingly and was signed into law by President Bill Clinton after a Hawaii court ruling briefly recognized such unions.

Increasing requirements for recognition of same-sex unions as marriages, combined with state anti-discrimination laws, have caused growing conflict with religious freedom.

Parents in some school districts have faced difficulty in exempting their children from classes voicing approval of same-sex relationships, while small businesses with moral reservations about participating in same-sex ceremonies have faced discrimination lawsuits. Catholic-run adoption agencies have been forced to close because the law would require them to place children with same-sex couples against their religious beliefs.

Those who supported efforts to defend marriage have also faced professional retaliation. In 2014 Mozilla CEO Brendan Eich was forced to leave the company he co-founded after activist groups and media publicized that he had donated to support California's Proposition 8.

The consequences for religious freedom were a topic of the court's deliberations in Obergefell v. Hodges. U.S. Solicitor General Donald Verilli at one point acknowledged that the high court's approval of a legal right to same-sex "marriage" could mean problems for the tax-exempt status of colleges with objections to recognizing the unions.