Maryland lawmakers tangled with one another and with many of the witnesses Friday at a lengthy same-sex marriage hearing that was at times argumentative, emotional and testy.

In pitching his bill to legalize gay nuptials, Gov. Martin O’Malley (D) was flanked by two African American ministers who testified that they support his legislation despite traditions at their churches that limit marriage to a man and a woman.

O’Malley argued that his bill provides equal rights for same-sex couples while not imposing on religious practices. He urged Maryland lawmakers to follow legislatures in seven other states — most recently New York and Washington — that have extended civil marriage rights.

“We have the opportunity to do the same thing,” O’Malley said at a joint hearing by two committees in the House of Delegates.

The motives of the governor and the two ministers who joined him were questioned by one of the leading opponents of the bill, Del. Emmett C. Burns Jr. (D-Baltimore County).

In testimony to his colleagues, Burns said he was “surprised and shocked” that O’Malley is pushing such a “divisive” measure at at time when the state has so many pressing economic needs.

Burns suggested that O’Malley must want to match New York Gov. Andrew Cuomo, a fellow Democrat who helped pass a same-sex marriage bill last year and who, like O’Malley, has been talked about as a potential contender for national office in 2016.

“I would love to see our governor as president of the United States, but not on the backs of his own people,” Burns said.

As for the two ministers, Burns said: “I don’t know what he’s promised them or what he’s told them. . . . There is something wrong with men marrying men and women marrying women.”

Delman Coates, one of the two ministers, testified that his personal beliefs about marriage and homosexuality were not the issue.

“The public policy question for me is simply whether gay and lesbian residents of this state deserve the same rights and benefits as the rest of us,” said Coates, senior pastor at Mount Ennon Baptist Church in Clinton. “For me, the answer to that question is a resounding ‘yes.’ ”

A similar bill passed the Senate last year but fell short in the House of Delegates.

The legislation’s course remains unclear this year in the House, an uncertainty that was underscored by the emotion at Friday’s hearing.

One of the other lawmakers who offered testimony, Del. Donald H. Dwyer Jr. (R-Anne Arundel), began his presentation with a video about families in Massachusetts who were upset about changes to school curriculum after the legalization of same-sex marriage in that state following a 2003 court ruling.

Del. Bonnie L. Cullison (D-Montgomery), a gay delegate and educator, sharply questioned Dwyer about his understanding of how school curriculum is developed in Maryland — an issue O’Malley’s marriage bill does not address.

Later, Del. Luiz R.S. Simmons (D-Montgomery) peppered a panel of religious leaders opposed to the bill with questions about the source of their opposition. Simmons suggested the only reasons were rooted in a desire to impose their religious beliefs on others.

“I have heard no evidence at all how same-sex marriage affects your families, the church. . . . There’s not a syllable of evidence. You just don’t like it,” Simmons said.

Others who came to the packed hearing, some of whom waited for hours for their turn, shared personal stories.

Stephen Reilly, an Annapolis business owner, said he was raised in Maryland from age 14 on by two lesbians. Reilly said his biological father left the family when he was 2 and a stepfather committed suicide when he was 13.

“I’d like to say the best dad I ever had is a woman,” Reilly, 38, told the lawmakers.

He later encouraged them to spend a day “with me and my family and see how normal we are.”