WASHINGTON – After fighting state by state for more than 20 years, the same-sex marriage movement is riding an extraordinary wave of legal victories as the Supreme Court prepares to decide whether gays and lesbians have a constitutional right to marry nationwide.

The justices meet for the first time Monday to consider a thick pile of pending appeals, and they have before them gay-marriage cases from five states. In all five, the ban on same-sex marriages was struck down. But unlike most appeals, both sides — the winners as well as the losers — are asking justices to hear the case.

"It's a near certainty the court will decide it this term and definitively answer" whether same-sex marriage is a constitutional right, said Irv Gornstein, a law professor who directs Georgetown's Supreme Court Institute.

Gay-rights advocates who once steered clear of the Supreme Court are now eager for a ruling. "There is no question we are winning, but winning is not won," said Evan Wolfson, founder of Freedom to Marry. "It's time for the Supreme Court to finish the job."

First, the justices have to settle on which case, or cases, they will hear, and that may take a few weeks. They could hear cases from Utah, Oklahoma, Virginia, Wisconsin or Indiana. In all but Virginia, the state's top lawyers are fighting to uphold laws banning same-sex marriage.

The swift pace of the lower court rulings has surprised many, including the justices. They were closely split in June 2013 when they struck down portions of the federal Defense of Marriage Act and sidestepped a constitutional ruling on the state ban in the Prop. 8 case from California. They expected it would be several years before the issue returned.

Instead, the state bans have fallen like dominoes when challenged in federal courts, beginning in the "red" states of Utah and Oklahoma, and moving from there to the Midwest and parts of the South.

Judges one after the other decided that states, when challenged, could put forth no convincing reason or justification for denying marriage to committed gay couples, many of whom had been together for many years and were raising children.

But state attorneys in four Republican-led states say they are determined to offer the Supreme Court a "robust" defense of their state laws. They noted their voters, as well as their lawmakers, had adopted measures in the past decade to define marriage as the union of a man and a woman. "It all comes down to this: Thousands of couples are unconstitutionally being denied the right to marry, or millions of voters are being disenfranchised of their vote to define marriage," said Utah's state attorneys in their appeal. "Either way, the court's review is necessary."