Maryland Gov. Martin O'Malley details proposed gun-control legislation earlier this month at the Maryland Statehouse. (John Wagner/The Washington Post)

Virginia, home to the National Rifle Association’s headquarters, the Nation’s Gun Show and a conservative legislature, is by many measures a more gun-friendly state than Maryland.

But in one aspect of gun control, Virginia is more restrictive than its neighbor across the Potomac. Residents of the commonwealth are almost three times as likely to be banned from owning a firearm for mental health reasons as residents of Maryland, which has been reluctant to restrict the rights of the mentally ill.

For the Democratic-controlled Maryland General Assembly and Gov. Martin O’Malley (D), this poses a dilemma. Their determination to pass one of the nation’s toughest gun-control policies in the current legislative session is bumping headlong into the desire to protect the rights and privacy of people with mental illness.

After last month’s school shooting in Newtown, Conn., O’Malley was quick to join several governors, Democrats in Congress and President Obama in proposing measures that would restrict access to firearms. O’Malley’s plan would ban assault weapons, institute strict gun-licensing requirements — and help him cement a progressive legacy as he eyes a possible presidential run in 2016.

The package is also notable for what it does not do: O’Malley has deliberately sought to steer clear of what he considers overly expansive restrictions when it comes to mental health, saying that going too far could scare people from seeking treatment.

But some leading law enforcement officials and legislators in O’Malley’s own party argue that his proposals don’t go far enough to strengthen a system they believe allows dangerous people access to weapons.

“Swiss cheese would look good by comparison. It’s riddled,” Del. Luiz R.S. Simmons (D-Montgomery) said of the current system. “This is really a screwed-up situation.”

O’Malley’s package is far less stringent on mental health than laws recently passed in New York, another liberal-leaning state. There, Gov. Andrew M. Cuomo (D) and the legislature agreed to require mental health professionals to inform authorities when they believe a patient is dangerous.

But even though a task force on mental health appointed by Maryland’s General Assembly recommended that the state pass a similar measure, the O’Malley administration decided against it, citing concerns about patient privacy.

Joshua Sharfstein, state secretary of health and mental hygiene, defended the decision, saying it was rooted in the best advice of mental health professionals, who say that the vast majority of people with mental illnesses are not violent.

“We’re trying to balance the importance of protecting people with the importance of the therapeutic relationship,” Sharfstein said. “If you have a very, very broad definition of reporting, it becomes very hard for people to seek help. That can create dangerousness and unintended consequences on the other side.”

Still, Simmons, the state delegate, said he will introduce a bill similar to what the task force suggested, focusing on mandatory reporting of the mentally ill who appear to have a clear and present intent to commit violence against others, but not those who threaten suicide.

While it may not go as far as some would like, O’Malley’s proposal, which has been endorsed by the state’s psychiatric foundation and some prominent researchers, does have some measures that deal with mental health issues.

It would add two new categories of residents who would be disallowed from purchasing firearms: those who no longer have power over their own legal decision-making because of mental illness, cognitive decline, disability or other reasons; and those who have been involuntarily committed and who a judge determines are a danger.

The state also would establish a 24-hour hotline for people to get help for a relative or friend who they think is suffering a sudden mental decline in late adolescence.

Maryland’s effort to address mental health issues is its first attempt since the 2007 shooting at Virginia Tech. In response to that massacre, Maryland started requiring everyone buying a gun to sign a waiver allowing authorities to do criminal and mental health background checks.

Virginia, where there are dramatically more gun purchases than in Maryland, took a tougher approach after Virginia Tech.

In the commonwealth, people are immediately banned from purchasing guns when they are ordered into treatment against their will. People found not guilty of a crime by reason of insanity also are put on the proscribed list, which as of January contained 184,133 names, according to state police.

By population, that means a Virginia resident is nearly three times as likely to be banned from possessing a firearm for mental health reasons as someone who lives in Maryland.

Virginia’s restrictions led the state to reject for mental health reasons 235 requests to buy firearms in 2011 and 340 in 2012.

It also has made it harder for those banned in Virginia to purchase a gun in other states. Virginia sends all of its data on involuntary commitments and compulsory treatment to the FBI’s national database.

State Police Lt. Col. Robert G. Kemmler called Virginia’s system critical to public safety. “It’s beneficial information to us as a law enforcement agency, when the whole purpose of the instant check program is to protect the public.”

Even with the 2007 waiver requirement in Maryland, the state has no comprehensive database of the dangerously mentally ill, and the state police, who regulate guns, cannot get access to records of patients from private psychiatric facilities, which in Maryland outnumber the handful run by the state.

Another problem with Maryland’s law, critics say, is how the state determines who should be banned from owning guns. For decades, the threshold has been people who have been committed to a state-run mental health facility for more than 30 consecutive days.

That has prohibited 42,242 Marylanders from possessing guns, according to state records. But that list has rarely halted a gun sale.

In 2011, just nine out of 46,339 applications for gun purchases in Maryland were denied because of the 30-day rule; 849 other attempts were denied because of the applicants’ criminal records and other reasons.

“There’s a huge gap,” said Montgomery County State’s Attorney John McCarthy. “The vast majority of commitments are less than 30 days.”

He also said that Maryland should, as the state task force recommended, require therapists to report their clients to law enforcement if they threaten to commit “serious violence” against a particular person or to kill themselves.

McCarthy said there have been dozens of cases in Montgomery in which patients experiencing psychotic episodes or facing other mental health crises have had access to firearms. In 2012, Montgomery police netted 103 guns in connection with emergency mental health evaluation calls, according to county police.

McCarthy wants the state to remove the 30-day rule and to provide state police with a much more comprehensive list of the dangerously mentally ill.

“We’re a free society; you’re never going to absolutely eliminate potential danger,” he said. But “we have to able to intelligently deal with the sharing of mental health information for the safety of police officers on the street,” as well as residents in their neighborhoods.

Although O’Malley’s plan would not change the 30-day rule, it would require private mental health facilities to share data with the state on patients who have been committed for more than 30 consecutive days. O’Malley’s proposal would also require the state to report all of its data to the FBI.

As of 2011, Maryland had reported only the roughly 3,000 who had been charged with crimes but deemed incompetent to stand trial or not criminally responsible for their actions. It had not reported to the FBI 42,000 who had been committed for more than 30 consecutive days. That list is checked only when a gun purchase is attempted within Maryland.

Sharfstein said it was unclear how many people the new requirements would restrict from purchasing a firearm but estimated that it would be in the “thousands.”

Combined with the other aspects of the governor’s plan, such as the strict licensing requirement, O’Malley said he believes that the mental health provisions would go a long way toward preventing another mass shooting.

“We can prevent another Newtown,” he said as he announced his gun-control package this month. Referring specifically to his mental health plan, he said, “Never again should we say, ‘If only we knew then.’ ”