Maryland Gov. Martin O'Malley speaks in support of a same-sex marriage bill during a news conference in Annapolis on Jan. 24. (Patrick Semansky/AP)

Half of Maryland residents now favor the legalization of same-sex marriage, but support varies significantly along the sensitive lines of race, religion and age, a Washington Post poll has found.

Overall, the Post poll found that 50 percent of Marylanders support allowing gay and lesbian couples to marry while 44 percent are opposed.

That is the highest recorded level of support in Maryland in a Post poll, about the same for the rest of the country as measured by another recent Post survey despite Maryland’s reputation as one of the nation’s most liberal states.

The new poll found a sharp divide among Maryland Democrats based on race. Among whites, 71 percent support same-sex marriage, while 24 percent do not. Among blacks, 41 percent are supportive, while 53 percent are opposed. Maryland has the largest percentage of African Americans of any state outside of the Deep South.

The poll findings highlight the challenge ahead for Gov. Martin O’Malley (D) as he tries to pass legislation this year in the heavily Democratic General Assembly, where there is a rift within his party over gay nuptials that mirrors public sentiment.

Debate in the General Assembly is intensifying on a bill that would make Maryland the seventh state, in addition to the District, to legalize same-sex marriage.

Several hundred people, including some ministers and lawmakers, convened Monday night in a rally outside the State House in Annapolis to make clear they still oppose legislation that narrowly passed the Senate last year but fell short in the House of Delegates.

In advance of a Senate hearing on the bill, gay-rights supporters are planning a news conference Tuesday morning with clergy members to show the measure has religious support in the 90-day legislative session.

In recent public appearances, O’Malley has sought to stress that “religious exemptions” included in his bill are intended to reassure religious leaders that they will not be forced to perform same-sex marriages.

The poll found that nearly three-quarters of those opposed to gay nuptials say their views stem primarily from their religious beliefs — a factor that makes lobbying on the issue more challenging.

By contrast, only 5 percent of same-sex marriage supporters say their views are largely shaped by religious beliefs. Supporters are far more apt to cite the views of their families and friends, personal experiences or their education as their main motivation.

The poll also found that those who attend religious services weekly are nearly three times as likely to oppose same-sex marriage as those who do not attend at all.

As in other parts of the country, there has been a trend in Maryland in recent years of growing support for gay unions, driven in part by the views of younger people.

The Post poll found that among adult residents younger than 40, support for same-sex marriage is 63 percent, with 33 percent opposed. Among those 40 and older, 42 percent are in favor, while 51 percent are opposed.

The mind-set of Daniel Carlin-Weber, 23, is fairly typical of his generation. A Dundalk resident who works at a film and video production company, Carlin-Weber got married in August and said he sees no reason why gay couples shouldn’t enjoy the same rights as him and his wife.

“We’re allowed tax benefits, things like that, and it’s a nice seal of approval — you know, these guys are a couple,” he said. “I feel everyone else should be treated the same way. There’s no reason not to do that.”

Overall, support for same-sex marriage in Maryland has grown steadily since 2004, when a Post poll found only 35 percent in favor, with 58 percent opposed.

Last year, only one Republican in the General Assembly voiced support for the bill, and O’Malley is largely targeting Democrats to pick up additional votes this year.

Among Democrats in Maryland, support has grown more rapidly among whites than blacks. During the past five years, support among whites has edged up, while support among blacks has been flat.

In interviews with poll respondents, several African American Democrats who said they generally support O’Malley said they cannot stand with him on gay unions.

“I try to live by the Bible,” said Charles Brown, 56, a truck driver from Salisbury. “God did not create man so Steve would turn out to be Eve, or Eve would turn out to be Steve.”

Even some respondents who said they have friends who are gay or lesbian said they do not believe they should be allowed to marry.

“It’s mostly a religious thing,” said Margaret Turner, 34, a Silver Spring resident who is a manager at a McDonald’s restaurant.

Turner said she “might eventually” change her views on the issues, but she said she’s not there yet.

Same-sex marriage is one issue this legislative session on which public sentiment could mean more than most. Advocates on both sides of the issue expect that if a bill passes, opponents will make use of a provision in the Maryland Constitution that allows residents to petition just-passed laws to the ballot.

The Post poll also found several other demographic differences when it comes to support of same-sex marriage among Marylanders.

Those at higher income levels are more likely to be supportive, as are those with more education. Support is more than double among those who identify themselves as “liberal” as those who call themselves “conservative.”

And support differs considerably by region. In Democratic-leaning Montgomery County, 62 percent say they support same-sex marriage, while 28 percent do not. In Prince George’s County, 36 percent are supportive, while 59 percent are opposed.

The poll was conducted by telephone Jan. 23-26 among a random sample of 1,064 Maryland adults. The results have a margin of error of plus or minus 3.5 percentage points.

Polling director Jon Cohen and polling analyst Scott Clement contributed to this report.