After months of eager anticipation mixed with nagging worries that this day may never come, gay couples across Massachusetts and beyond converged on Cambridge on Sunday night to apply for the nation's first state-sanctioned, same-sex marriage licenses.

At 12:01 a.m. Monday in this city across the Charles River from Boston, the first of several dozen couples who had lined up outside City Hall in the rain early Sunday was called into a basement corridor to declare their intention to marry.

Marcia Hams, 56, and Susan Shepherd, 52, of Cambridge, who have been together for 27 years, were the first couple to line up, at midnight Saturday, and were the first to apply for a marriage license before a crush of cameras.

"I feel real overwhelmed, real happy," Shepherd said. "I could pass 0ut at this point." Hams and Shepherd plan to marry next Sunday.

By 10 p.m. Sunday, more than 1,000 people -- including couples waiting in line and their supporters throwing rice and confetti -- were gathered outside City Hall, along with fewer than a dozen protesters. At 10:30 p.m., couples began receiving numbers to determine the order in which their applications would be processed, and an hour later 230 couples had passed through the front doors.

The city also organized a celebration, complete with live music and speeches from activists, and a giant wedding cake that was cut after the stroke of midnight.

An interfaithservice called "Blessings on the Eve of History" to commemorate the start of gay weddings was held Sunday evening in Cambridge's Christ Church.

During a sermon praising what he called "the triumph of freedom over oppression," the Rev. Steven Charleston said opponents of gay marriage say it will end civilization as they know it. "Perhaps they're right," he said to wild applause.

After he spoke, Jewish and Christian clergy fanned out to bless dozens of same-sex couples in the pews.

Cambridge Mayor Michael A. Sullivan, whose city was the only one in the state that started the license-application process the minute it became legal, said: "We're a diverse and accepting community, and this is a way to welcome the couples and their families. That's what it's all about. It's not a race. It's about fairness and equality."

The landmark 4 to 3 ruling by the state Supreme Judicial Court (SJC) in November deemed unconstitutional a ban on gay marriage. It was stayed for 180 days to give the state time to prepare.

In recent months, a host of challenges to the decision have been beaten back in the courts, including a request for a federal injunction that the U.S. Supreme Court denied Friday. An appeals court will hear the matter in June.

Lawmakers who opposed the SJC's ruling have begun amending the state's constitution to outlaw gay marriage, giving preliminary approval in March to a measure that could be on the ballot by November 2006.

On Monday morning, the state's other 350 city and town clerks will begin issuing marriage licenses to same-sex couples, and weddings will be held throughout the state.

"It's been an emotional roller coaster," said Marianne Duddy-Burke, 43, of the period since the SJC decision. She plans to be married to her partner of 10 years at a Boston hotel in June, but added a clause to the reservation contract so she would not lose her deposit if legal circumstances change.

Gloria Bailey of Orleans, Mass., said that Monday would be "the culmination of a lifelong dream." She and Linda Davies, her partner of 33 years, were among the couples whose lawsuits led to the November court decision. They gathered with the six other plaintiff couples for a "rehearsal brunch" Sunday in Brookline, Mass., and plan to be married on Cap Cod's Nauset Beach.

All couples planning to marry Monday must have submitted their applications, then paid a fee to waive the required three-day waiting period before picking up their licenses. There is no way of knowing how many couples will be married here in the coming weeks, or who will be first.

As of Friday afternoon, Fenway Community Health, a Boston health center that caters to gay patients, had conducted more than 450 premarital blood tests. More than 100 others had been scheduled.

Towns with large gay populations, such as Northampton and Provincetown, also expected many applicants.

Even harder to predict is how many couples from outside Massachusetts will be traveling here to marry. Invoking a 1913 statute that has rarely been enforced in recent years, Gov. Mitt Romney (R) declared that same-sex couples who live in other states are ineligible to marry in Massachusetts because they cannot legally marry in their own states.

Calling that interpretation discriminatory, officials in Provincetown voted last week to marry out-of-state couples, and clerks in Worcester and Somerville have indicated they also will. Other cities, including Boston and Cambridge, have said they will follow Romney's guidelines, but will not require proof of residency.

Romney has threatened legal consequences against clerks who do not follow his guidelines. He said licenses issued to out-of-state couples would be "null and void," a stance that is expected to be challenged in court.

At least two gay couples traveled from New York to Boston last weekend, as part of a group organized by the Civil Marriage Project, which last year arranged similar trips to Canada. Robin Goldman and Cris Beam said they plan to apply for a marriage license Monday in Somerville and to marry there May 20.

"I certainly don't discourage couples from out of state from coming here, I just tell them what the consequences are," said J. Mary Sorrell of Amherst, Mass., who became a justice of the peace in February because she wanted to help gay couples marry. She said she expects to officiate at 24 same-sex weddings in the next two weeks, including five for out-of-state couples.

Staff writer Alan Cooperman in Cambridge contributed to this story.

Marcia Hams, left, and Susan Shepherd are the first same-sex couple in Cambridge to fill out an application for a marriage license. "I feel real overwhelmed, real happy," Shepherd said.