PORTLAND — Gay couples in Maine will be able to get married before the end of the year, possibly as early as Dec. 29 in some cities and towns, now that the state has certified the Nov. 6 election results, the secretary of state’s office said Monday.

In some towns, couples will have to wait until Monday, Dec. 31, because the new law allowing same-sex marriage goes into effect on a Saturday, when city and town offices are normally closed.

The timing of the law’s effective date falls 30 days after Gov. Paul LePage certified voting results, which he did on Thursday, said Megan Sanborn, spokeswoman for the secretary of state’s office.

Sanborn said her office makes no decision on whether city or town offices open on that Saturday.

“That will depend on the municipalities,” she said.

In Portland, Mayor Michael Brennan said he would look into the possibility of opening City Hall on Saturday, possibly at midnight, for the city’s — and possibly the state’s first — same-sex marriage ceremony.

“We just found out about this today, and we’ll look into all the details and make a determination from there,” Brennan said in his office Monday afternoon. “We can’t say for sure we’ll be open on Dec. 29 or rule that out as a possibility.”

But whether it’s Dec. 29 or Dec. 31, Brennan said, he’s certain of one thing: He wants to be there.

“I’m going to be very pleased and happy when the first (same-sex couple) in the city of Portland gets to be married in a ceremony of their choosing,” Brennan said. “Certainly this is a historic event. I think if Portland could be part of this historic event, we’d want to be.”

Maine residents on Nov. 6 voted 53 to 47 percent to approve gay marriage, making Maine the ninth state to allow gay and lesbian couples to marry.

Betsy Smith, executive director of the pro-gay marriage group EqualityMaine, said her group would not lobby cities or towns to change their hours.

“We’re first going to find out whether city halls and town halls have hours on Saturday. If there are some with Saturday hours, then theirs will be the first,” Smith said.

Even Smith was caught off guard by the timing of the law’s effective date. She had expected the governor would wait until the deadline rather than sign the voting results early, and that the law would go into effect on Jan. 5, 6 or 7, she said.

“The question is, are people going to line up for marriage licenses for Saturday on Dec. 29 or Monday on Dec. 31? I don’t know,” she said.

Sarah Dowling and Linda Wolfe of Freeport have been together for 18 years and were at the forefront of the fight to legalize gay marriage in Maine for many of those years.

Dowling, reached by phone Monday afternoon, said she has talked to many people since the day she heard that gay marriage in Maine would become legal. But she hadn’t had a chance to talk to Wolfe.

They had what Dowling called a “non-legal wedding” 16 years ago, followed by a civil union in Vermont on their fifth anniversary. And they had talked about getting legally married in one of two ways: at Freeport Town Hall or their church on July 27, the earliest possible day they could schedule a wedding there.

“I don’t know that I want to wait one second,” she said.

Dowling said she would like to be the first gay couple in the state to be married, but will check with Freeport Town Hall and then discuss it with Wolfe. No matter their decision, she said the news on Monday made it an exciting day.

“I’m happy for us. I’m happy for our children and I’m happy for our grandchildren and the world they are going to grow up in,” Dowling said. “And I’m happy for wedding cake too.”

Carroll Conley, executive director of the Christian Civic League and a vocal opponent of the ballot initiative to legalize same-sex marriage, said he hasn’t been able to get the state to answer many questions he still has about how gay marriage will be implemented.

“We’re dealing with notaries and clerks and religious organizations,” Conley said. Many of them don’t approve of gay marriage on religious grounds and object to taking a role.

He argued that cities and towns should consider voting to appoint deputy clerks to issue same-sex marriage licenses in places where clerks are “conscientious objectors.”

“The other issue we’re dealing with is religious institutions that rent their properties out for weddings,” Conley said. He said churches that don’t want to open their doors to same-sex couples don’t know what their rights would be now if they refused to allow same-sex ceremonies.

“We do have some legal advice that it’s a different circumstance when a church is renting to just its members as opposed to the general public,” Conley said. “Before we advise churches, we want to make sure that we are giving them sound advice.”

In South Portland, City Hall won’t be open on Dec. 29, but will be open during normal business hours from 8 a.m. to 4:30 p.m. Dec. 31, with marriage licenses available until 4 p.m, Assistant City Clerk Karen Morrill said.

Morrill said she hasn’t heard from a lot of people asking when same-sex couples could come in to get married, but that may be because the clerk’s office had already posted a sign saying it wouldn’t be an option before Dec. 26.

Marriage ceremonies at South Portland City Hall need to be scheduled by appointment. People can get marriage licenses on a walk-in basis, she said.

“I’m hoping we’ll be bombarded,” Morrill said.

Morrill supports the new law, and said that in her role as a notary public, she could legally refuse to conduct a marriage ceremony, but that the South Portland city clerk’s office wouldn’t do that.

“We would never refuse anyone,” she said.