A gay pride flag flies below the U.S. flag during a celebration of the Supreme Court's ruling legalizing gay marriage at a rally on Friday in Ann Arbor, Mich. (Rebecca Cook/Reuters)

IN ISSUING on Friday one of the most significant rulings of this century, the Supreme Court didn’t stake out the strongest legal grounds available to it — but it got to the just result, finding that the 14th Amendment requires states to license same-sex marriages. This is a signal moment in the advancement of civil rights, one that will not come without disagreement and controversy, but one that the country is ready for.

“The challenged laws burden the liberty of same-sex couples, and they abridge central precepts of equality,” the ruling, written by Justice Anthony M. Kennedy, declares.

The court majority cites two 14th Amendment clauses to justify its ruling: the command that Americans’ liberties cannot be deprived without due process of law and the guarantee of equal protection of the law. But it concentrated on due process, finding that gay men and lesbians have a fundamental right to marry that states must respect.

Chief Justice John G. Roberts Jr. pushed back hard in a dissent, arguing that the court must be more careful in basing rulings on implied rights it discovers in the Constitution, which can lead to arbitrary judging. That argument has power. It does not, however, weaken the equal protection claims of gay men and lesbians, which the court’s opinion mentions but does not give due weight and attention.

The case should have turned on this point: Opponents of same-sex marriage failed to argue that there was sufficient basis for the state to discriminate against gay men and lesbians in setting their definitions of marriage. Historical understandings of marriage, to which Mr. Roberts accords considerable reverence, are wholly inadequate to justify continuing discriminatory treatment. Under the equal protection clause, only a sufficiently strong relationship to a real state interest could provide that justification. And there is none.

Mr. Roberts also questioned whether a court decision is the right way to secure marriage equality. “Supporters of same-sex marriage have achieved considerable success persuading their fellow citizens — through the democratic process — to adopt their view,” he wrote. “Stealing this issue from the people will for many cast a cloud over same-sex marriage, making a dramatic social change that much more difficult to accept.”

Yet the fact that it’s foreseeable to Mr. Roberts that same-sex marriage bans would fall, state by state, to popular pressure shows how far the country has come, and quickly. In states where lower courts had already ordered same-sex marriages to commence, the transition has been generally calm. We expect to see the same maturity and acceptance across the country now.

That doesn’t mean everything will be easy. The court has opened some new questions. For example, will religious schools lose their tax-exempt status if they don’t recognize same-sex marriages? Judges might have to decide. The court also couldn’t answer many open questions regarding rights for gay men and lesbians, particularly about whether it should be legal for employers to fire people based on their sexual orientation or whether businesses should be able to refuse service to same-sex couples. Elected lawmakers will have to make these calls.

After Friday, though, one can be forgiven for feeling a sense of inevitability about civil rights for gay men and lesbians. Future generations will wonder how, in an advanced society with a devotion to equal treatment under the law, they could ever have been denied.