Maryland Gov. Martin O’Malley said Friday that he is inclined to sponsor a bill next year to allow same-sex marriages, a move that gay rights advocates in his state have been urging.

“I’m certainly leaning that way,” O’Malley (D) said during an interview in the Utah capital, where he is attending a meeting of the National Governors Association. “There are some bills that sometimes require a governor to push them to get them over the goal line, and it could well be true of this one. . . . All of us are going to have to work a lot harder.”

O’Malley had expressed support for a same-sex marriage bill that fell short during this year’s legislative session, but his lobbying efforts were limited largely to private conversations with lawmakers.

In the wake of New York’s recent embrace of same-sex marriage, gay legislators and other advocates in Maryland have been pressing O’Malley to play a far more visible role next year, including making the bill part of his formal legislative package.

In New York, Gov. Andrew M. Cuomo (D) was widely credited with the passage of a same-sex marriage bill in a divided legislature after a very high-profile lobbying effort.

“I think New York showed us all that a consensus was possible on this, and this issue continues to evolve at a fast pace in the hearts and minds of citizens,” O’Malley said.

He said his office is studying exemptions for religious organizations contained in New York’s legislation with an eye toward strengthening similar measures that were included in Maryland’s bill this year. O’Malley did not cite specifics.

Maryland’s bill passed the Senate this year but did not come to a vote in the full House of Delegates, where supporters said they were a couple of votes short. During this year’s debate, several delegates grew uneasy about the legislation as black churches in Prince George’s County and other opponents, including the Catholic Church, stepped up the fight.

The bill was also a hard sell among some Democrats in more conservative districts in Southern Maryland and the Baltimore suburbs, and only one Republican in the legislature supported the measure.

Advocates on both sides are gearing up for another fight in the next 90-day legislative session, which starts in January.

O’Malley typically wins more legislative battles than he loses in the Democrat-led General Assembly, but some high-profile bills of his have been defeated in recent years, including one this year to jump-start Maryland’s wind-energy industry.