WORCESTER, Mass. - Massachusetts became yesterday the first state to legalize same-sex marriage, ending a centuries-old tradition in the United States that limited matrimony to one man and one woman.

Although gays and lesbians held wedding ceremonies earlier this year in San Francisco, Oregon, New York and New Mexico, the unions were not legally sanctioned. Vermont legalized civil unions four years ago, granting same-sex couples the same rights as married people within the state, but without using the word "marriage."

In legalizing same-sex marriage, Massachusetts joined Belgium, Denmark, the Netherlands and the three most populous provinces in Canada as the only places in the world where gays and lesbians can legally marry.

A November ruling by Massachusetts' highest court made May 17 the official launch date for same-sex marriage. After Cambridge jumped the gun on every other community in the commonwealth by issuing marriage licenses at 12:01 a.m., hundreds of same-sex couples flocked to city and town clerks from Barnstable on Cape Cod to Boston and Great Barrington.

In Provincetown, a seaside resort that boasts the largest concentration of gays and lesbians of any community in the United States, couples seeking marriage licenses began arriving at the town hall at 4:30 a.m. - four hours before the big wooden building on Commercial Street was scheduled to open. Once the couples got their licenses, they stepped outside to applause from a crowd that grew larger and more jubilant as the day wore on.

"I guess the word I would have to use today is surreal," said Peter Bez, a Provincetown innkeeper who took out a marriage license with his partner of 27 years, artist Chuck Anzalone.

Just after noon, Bez and Anzalone became the 100th couple of the day to get a license in Provincetown. Last year, 19 marriage licenses were issued there.

"It doesn't seem like it is happening," Bez said. "But I guess it is, right here in my own back yard."

Many from out of state

Attorney Bennett Klein said that among the dozens of couples obtaining licenses in Provincetown, many were from out of state - defying an order from Gov. Mitt Romney that only same-sex residents of Massachusetts could marry here. Klein's organization, Gay and Lesbian Advocates and Defenders, argued the case that generated the Supreme Judicial Court's landmark decision.

In Boston, a spokesman for the Coalition for Marriage, a group opposed to same-sex marriage, pledged to keep fighting for a constitutional amendment banning such unions - at the state and federal levels.

Massachusetts state legislators passed a constitutional amendment this spring to define marriage as a union between one man and one woman. But before it can become law, the measure must be approved again by lawmakers in 2005 and then passed as a ballot initiative in the 2006 general election.

"We feel that just because same-sex marriage has been ruled legal, that does not make same-sex marriage right or healthy for society at large," said Ray McNulty, communications director of the Coalition for Marriage.

But at City Hall plaza in Boston, nothing could detract from the atmosphere of celebration. Mayor Thomas Menino greeted three couples who were plaintiffs in the lawsuit - including Julie and Hillary Goodridge, who lent their name to the case.

'Partners for life'

The soft sounds of a string quartet drowned out a sprinkling of protesters. Couples carried flowers; some wore full wedding attire as they arrived to take out marriage licenses.

Josh Friedes of the Freedom to Marry Coalition, a gay-rights advocacy group, said the packed congregation at Boston's Arlington Street Church burst into tears when the Rev. Kim Crawford Harvie pronounced David Wilson and Robert Compton - two of the Goodridge case plaintiffs - "partners for life."

Massachusetts normally requires a three-day waiting period, but scores of couples obtained court waivers so they could wed immediately. Compton and Wilson exchanged vows at 10 a.m., the first of the seven plaintiff couples to marry yesterday.