Jon A. Kaplan imagines a beautiful wedding ceremony on the beaches of the Eastern Shore, followed by a big party in Baltimore, where he and partner Joel Pearson, have lived for more than a decade.

Dan Gilbert likes the simplicity of signing a marriage license with Bill Wernick at Baltimore's City Hall.

Shanti Heffern and August DiMucci have already had their celebration, but theHampden couple is eager to become official in the eyes of the law.

Maryland's gay and lesbian couples have fresh hope that their nuptials can one day take place in their home state after Gov. Martin O'Malley said Friday that he will lead the legislative effort in January to legalize marriage for same-sex couples. The Democrat said the measure would be among a "small handful" of legislative priorities for his sixth year in the governor's office.

A gay marriage bill that was approved this year by the state Senate was pulled from the floor of the House of Delegates after vote-counters determined that they were a few votes short. O'Malley's leadership could make the difference, say gay marriage supporters, who point to Gov. Andrew M. Cuomo's efforts in New York, which begins issuing licenses to same-sex couples Sunday.

If the O'Malley-backed bill receives the blessing of the Democratic-led General Assembly and is signed into law next April, Maryland would become the seventh state to issue marriage licenses to same-sex couples. Several other states allow civil unions.

But even with the governor's support, the coalition of gay advocates, civil liberties groups, and labor and religious leaders pushing for gay marriage faces challenges.

To assemble the votes for passage, they must win over some Republicans -- only one voted for the bill last year -- or persuade Democrats who say their religious beliefs and those of their constituents recognize marriage as only between a man and a woman.

And even if a bill becomes law, it could face an aggressive referendum effort similar to one this year that will give Marylanders the final say on the legislation that would extend in-state tuition breaks to illegal immigrants.

If a similar petition drive were successful, the marriage law would be suspended until November 2012, when it would appear on the presidential election ballot alongside the tuition law.

"I think a lot of people are exhausted from waiting," said Lisa Polyak, who sued Maryland in 2004 for the right to marry Gita Deane. They and other plaintiffs won in Baltimore Circuit Court, but the decision was ultimately overturned by the state's highest court.

Polyak and Deane, a couple for nearly 30 years and the mothers of children ages 12 and 15, married in February in Washington. TheDistrict of Columbia began issuing marriage licenses to same-sex couples last year.

"We decided we had been waiting and waiting for so long," Deane said.

Still, gay couples said that O'Malley's explicit backing of legislation to allow same-sex marriages -- by far the clearest stand taken by a lifelong Roman Catholic who said in 2006 that he believed marriage could only be between a man and a woman -- infuses the issue with excitement and leadership.

His announcement Friday renewed hope for Heffern and DiMucci -- so much so that the Hampden women no longer plan to go to Washington next month to complete paperwork certifying them as spouses.

"Obviously, we'd rather get married in our home state," Heffern said Friday from Hawaii, where she and DiMucci were celebrating their legally unrecognized wedding ceremony, held May 14 at a Baltimore hotel.

The two schoolteachers felt strongly about celebrating their union in Baltimore. At the same time, they have long wanted to make it official in the eyes of the law, and the District of Columbia has been the nearest jurisdiction to recognize same-sex marriages.

This is not the first time that Heffern, 34, and DiMucci, 37, have postponed plans to get their marriage certificate in the district. They decided against a Washington ceremony earlier this year, when Maryland lawmakers appeared to be on the verge of legalizing gay marriage. When the bill died in the House, they revived the plan. Until Friday.

Heffern said the experience -- hope, followed by disappointment, now replaced by new optimism -- has been frustrating.