Maryland Republican gubernatorial candidate Larry Hogan. (Patrick Semansky/AP)

The National Rifle Association on Monday announced its endorsement of Republican Larry Hogan in Maryland’s gubernatorial contest, citing his “support and commitment to the Second Amendment.”

The backing by the organization’s Political Victory Fund comes in a race in which Hogan’s opponent, Lt. Gov. Anthony G. Brown (D), has spent a lot more time talking about Hogan’s positions on guns than the Republican has.

Brown has aired provocative television ads featuring an assault rifle resting against a swing set to highlight Hogan’s opposition to a sweeping gun-control bill passed by the legislature last year. Hogan, meanwhile, has sought to downplay the importance of the issue, pledging that he wouldn’t seek to overturn the year-old law and accusing Brown of trying to scare voters on an issue not central to the campaign.

In a news release issued Monday, the NRA said that “Larry Hogan respects the rule of law and the Second Amendment rights of Maryland’s law-abiding citizens. In sharp contrast, his opponent, Lt. Governor Anthony Brown, is a true enemy of gun owners’ rights.”

Hogan spokeswoman Erin Montgomery said Hogan had not sought the NRA endorsement. “It was a surprise to us,” she said.

The NRA had previously awarded Hogan a grade of “A-” for his answers on a wide-ranging questionnaire. Brown received a grade of “F” from the group.

Hogan has resisted calls in recent weeks by gun-control advocates, including the Brady Campaign to Prevent Gun Violence, to make his answers public.

On Monday, Gov. Martin O’Malley (D), who has endorsed Brown, announced the launch of an online petition drive meant to pressure Hogan to release a copy of the questionnaire.

“Why would he share his views and plans with the NRA, but hide them from the people of Maryland?” O’Malley asked in an e-mail sent out by his political action committee.

The NRA questionnaire included 27 questions, including several on repealing portions of the Firearm Safety Act passed last year. Other questions gauged support for loosening a law that limits residents to purchasing one handgun a month and eliminating a seven-day waiting period to buy a handgun.

Hogan’s views on guns also drew scrutiny in a Washington Post story this month in which several gun-rights advocates said he had assured them that he would work to expand access to firearms if elected governor, even though he was talking little about that during his campaign.

In postings on a popular message board and in interviews with The Post, several advocates said Hogan had pledged to install a state police superintendent more sympathetic to gun owners and make it easier to obtain permits to carry concealed weapons, as well as to take other steps that don’t require the consent of the Democratic-led legislature.

Hogan has been publicly dismissive of the story and denied he offered such assurances.

The sweeping gun-control law passed by the legislature last year banned 45 types of assault-style rifles as well as magazines that hold more than 10 rounds and includes new fingerprinting, training and permitting requirements for those seeking to buy a handgun.

Hogan said in a recent debate that he opposed it because it did not go far enough in restricting mentally ill people from obtaining guns. He had previously said the legislation “went too far,” citing his support for the Second Amendment.

Brown campaign manager Justin Schall said Monday that Hogan “has refused to release his NRA questionnaire because he doesn’t want Marylanders to know the truth about his pro-gun agenda.”

“There’s a clear choice in this election,” Schall said. "Anthony Brown fought to pass the Firearm Safety Act, while Larry Hogan opposed it.”