Today’s two Supreme Court rulings involving same-sex marriage were a huge and gratifying victory in the long struggle to end government-sanctioned discrimination against gay and lesbian Americans.

It is sad, this deep into the national conversation about equal rights, that five justices were not willing to recognize a constitutional right for all couples to marry, regardless of the state where they live or their genders.

But the momentum for marriage equality seems unstoppable, and such a breakthrough will eventually come.

The first ruling struck down the central provisions of the Defense of Marriage Act, the odious 1996 federal law that denied federal benefits to same-sex couples married in jurisdictions that permit such unions.

The second decision will nullify Proposition 8, California’s voter-approved ban on same-sex marriage.

Both decisions are huge victories for the gay rights movement that propels the nation toward greater fairness and full equality.

However, as many observers predicted, the Roberts court failed to deliver the larger verdict that the Constitution calls for in its equal protection clause: a broad ruling establishing a nationwide right of same-sex couples to wed. The court missed a historic chance to correct a longstanding injustice and left gay people in much of the country relegated to an inferior status that a growing majority of Americans knows is wrong.

The court may have believed that the country is not ready for such a sweeping approach.

If so, it has overestimated the issue’s divisiveness and underestimated the human costs of further delay.

In the first case, United States v. Windsor, a 5-to-4 majority overturned a portion of the Defense of Marriage Act that defined marriage as a union only between a man and a woman for the purposes of more than 1,000 federal laws and programs.

The plaintiff in the case, a New York octogenarian named Edith Windsor, brought her challenge after she was required to pay some $360,000 in federal estate taxes from which opposite-sex spouses are exempt.

The Defense of Marriage Act did not allow the Internal Revenue Service to treat Ms. Windsor as a surviving spouse following the death of Thea Clara Spyer, the woman with whom she lived for more than 40 years and married in Canada in 2007.

The Defense of Marriage Act was “unconstitutional as a deprivation of the equal liberty of persons that is protected by the Fifth Amendment,” Justice Anthony Kennedy wrote in the majority opinion that was joined by Justices Ruth Bader Ginsburg, Stephen Breyer, Sonia Sotomayor and Elena Kagan.

By seeking to injure the class New York had sought to protect by allowing same-sex marriages, the act “violates basic due process and equal protection principles applicable to the federal government.”

The law’s insidious provisions were the last in federal law to require discrimination against gay people.

The majority was right not to seize upon the odd procedural posture of the case — the Obama administration sought Supreme Court review although it had stopped defending the Defense of Marriage Act and won a lower federal court ruling finding it unconstitutional — in order to avoid reaching the merits, as the court’s other four justices favored.

In the Proposition 8 case, Hollingsworth v. Perry, a differently composed 5-to-4 majority led by Chief Justice John Roberts Jr. avoided ruling on the merits of the constitutional challenge to the discriminatory ballot measure by finding that its proponents lacked standing to appeal.

Nevertheless, on a hugely positive note, the court’s feint clears the way for same-sex marriages in California.

The dismissal of the Proposition 8 challenge leaves intact the sound 2010 ruling by a now-retired federal trial judge in San Francisco, Vaughn Walker.

Following a much-publicized three-week trial, he found that same-sex marriage caused no harm whatsoever to the state or society but substantial harm to same-sex couples by depriving them of their rights to equal protection and due process.

With California joining a dozen other states and the District of Columbia already in the marriage equality column, roughly 30 percent of Americans live in places where same-sex marriage is allowed.

Americans’ acceptance of same-sex marriage, and the legal and political support for it, have come very far, very fast in the four years since two prominent lawyers on opposite sides of the 2000 Bush v. Gore case, Theodore Olson and David Boies, filed the challenge to Proposition 8 that culminated on Wednesday.

But there are miles yet to travel on this civil rights journey.

The new marriage rulings leave behind an unsupportable state-by-state patchwork that threatens valid marriages when state lines are crossed.

Cases already in the pipeline could give the Supreme Court another chance to fully confront the harm to real people’s lives and establish marriage equality nationwide. Soon, we hope.