Maryland Lt. Gov. Anthony G. Brown, left. (AP Photo/Patrick Semansky). Maryland Attorney General Douglas F. Gansler, right . (Photo by Ricky Carioti/The Washington Post).

Two leading Democratic candidates for governor of Maryland testified in the House of Delegates on Friday for competing bills that both would allow judges to impose harsher sentences on abusers who commit acts of domestic violence in front of children.

Lt. Gov. Anthony G. Brown took the lead in presenting a bill sponsored by Gov. Martin O’Malley (D) to the House Judiciary Committee.

About an hour later, Attorney General Douglas F. Gansler testified to the same committee on similar legislation sponsored by Del. Luiz R.S. Simmons (D-Montgomery).

The two bills have only minor differences. Simmons’s bill, for example, would not apply to acts committed in front of children under 2 years old, while the administration bill does not include that exception.

In this election in Maryland, jockeying for attention at the legislature has become commonplace. On Friday, Gansler and Brown, who are involved in a bitter primary battle, each offered some gracious words about the other’s preferred legislation.

Gansler said that while he believes Simmons has a better bill, he supports the O’Malley legislation as well.

“I couldn’t care less who gets credit,” Gansler told the House panel. “I just want it to get done.”

In his testimony, Brown publicly thanked Simmons, a member of the committee, for his efforts to pass his version of the legislation for the past seven years.

“We think this is an improvement upon what you did,” Brown told the committee, which last year gave a favorable report to Simmons’s bill. The legislation did not make it to the governor before the session ended.

Before Friday’s hearings, both Democratic hopefuls made themselves available to the media.

Gansler, a former Montgomery County state’s attorney, told reporters that combating domestic violence “is an issue that has been very near and dear to me.”

Brown, in an interview, expressed confidence that the bill sponsored by O’Malley would pass this year. “I understand how to move a bill,” he said.

Del. Heather R. Mizeur (D-Montgomery) is also competing in the Democratic primary for governor.