Among them were Steven Bridges and Michael Snell, who held a commitment ceremony six years ago but made marriage official under state law with a simple ceremony.
"It's historic. We've waited our entire lives for this," said Bridges, a retail manager, who's been in a relationship with the Snell, a massage therapist, for nine years. Bridges, 42, and Snell, 53, wore lavender and purple carnations on black T-shirts with the words "Love is love."
With Snell's two adult daughters looking on, they exchanged vows in the city clerk's office after getting the first marriage license issued to a same-sex couple in Portland.
Voters approved gay marriage in November, making Maine and two other states the first to do so by popular vote. The law is already in effect in Washington state; Maryland's takes effect on Tuesday, the first day of 2013.
Gay marriage was already legal in New York, Connecticut, Iowa, Massachusetts, New Hampshire, Vermont and the District of Columbia, but those laws were either enacted by lawmakers or through court rulings.
The Maine Legislature had once approved same-sex marriage, but it was overturned by a statewide referendum three years ago, crushing couples who had already made wedding plans.
Gov. Paul LePage signed off on the certified election results on Nov. 29, so the new law was to go into effect 30 days from that date. In addition to gay marriage becoming legal, same-sex marriages in other states will now be recognized by the state of Maine.
Nobody knew exactly how many couples would be rushing to get their marriage licenses early Saturday. Falmouth joined Portland in opening at midnight. A handful of other communities including Bangor, Brunswick and Augusta planned to hold special Saturday hours.
In Portland, the mood was festive with the crowd cheering and horns sounding at midnight as Bridges and Snell began filling out paperwork in the clerk's office in Portland City Hall.
More than a dozen couples stood in line to wait their turn amid the festive atmosphere. There were free carnation boutonnieres and cupcakes, and a jazz trio played.
Outside City Hall, a couple hundred people cheered Snell and Bridges when they emerged newly married, breaking into an impromptu song, the Beatles' "All You Need is Love."
Donna Galluzzo and Lisa Gorney also planned a midnight wedding, and theirs had all the trappings. They dined Friday night with friends, and then took a limo to City Hall. They had their rings, flowers, wedding vows and a friend to perform the ceremony.
They ended up near the back of the line awaiting marriage licenses, but that didn't matter.
"We decided it's a historic day and we thought it would be awesome to be a small part of history, to say we got married on the first day it's legal," Galluzzo said.
Not everyone was getting married right away.
Suzanne Blackburn and Joanie Kunian, of Portland, were among those in line to get their license at midnight, but they didn't plan to wed immediately. One of their grandchildren wanted them to get married on Valentine's Day.
"I don't think that we dared to dream too big until we had the governor's signature," Blackburn said. "That's why it's so important, because it feels real."
Follow David Sharp on Twitter at http://twitter.com/David—Sharp—AP