Maryland Gov. Martin O’Malley’s (D) administration will bow to mounting opposition from members of his own party and back significantly tougher rules to get guns out of the hands of the dangerously mentally ill, administration officials said Tuesday.

Under the governor’s modified plan, Maryland would adopt a law similar to one passed in Virginia after the 2007 massacre at Virginia Tech that would prohibit anyone involuntarily committed to a public or private mental health facility for any length of time from purchasing a gun.

O’Malley had initially sought to keep in place a decades-old threshold that prohibits gun purchases only by those committed to mental health facilities for 30 consecutive days or more. He also sought a new judicial step that would have required a court to declare that those involuntarily committed are “potentially dangerous” to others before restricting their rights to guns.

But with moderate Democrats questioning whether the governor’s provision went far enough to protect the public, O’Malley aides on Tuesday signaled the governor’s willingness to back a tougher provision similar to Virginia’s. A vote could come in the Senate Judiciary Committee as early as Thursday.

The mental-health measure is one of four components in a gun-control bill that O’Malley proposed after the December school massacre in Newtown, Conn. His bill would also ban assault weapons, tighten school security and require residents to submit digital fingerprints to obtain a license to buy a gun.

While the licensing requirement would be among the strictest nationwide, O’Malley (D) has faced a liberal’s dilemma on gun control and mental health, seeking to restrict access to firearms by those who may be violent while also protecting the rights and privacy of people with mental illness.

Joshua Sharfstein, O’Malley’s secretary of health and mental hygiene, said in an interview that the administration had come to view the Virginia model as more in line with federal guidelines aimed at getting the names of the potentially dangerously mentally ill into an FBI database used for background checks at the time of gun purchases.

“Also, it’s easier to implement and may help prevent some suicides,” Sharfstein said.

At an eight-hour hearing this month in the Senate Judiciary Committee, Maryland’s mental health professionals were split on tightening rules for mental-health patients. Some warned that a strict rule limiting gun ownership could deter those who may need treatment most from seeking it.

Barring gun ownership from people who have been involuntarily committed appears to be a compromise that some of the state’s leading voices on mental health will support.

“If you are involuntarily committed, you have gone through a [court] process that would indicate you are a danger to yourself or others, or at least at an increased risk of being that,” said Joshua Cohen, president of the Maryland Psychological Association.

Family members, police and others can now petition to have a Maryland resident’s mental health evaluated at a hospital. But if health-care providers think a person should be committed, only a judge can issue the order, and only on the basis that the person presents a danger to himself or others.

Cohen, a Rockville psychologist, said the tougher proposed law would still be far more limited than one recently approved in New York. 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. In the most serious cases, the New York law would let law-enforcement authorities keep such patients from purchasing guns and confiscate guns they already own.

Critics in the mental-health community say the law will have a chilling effect on the patient-physician relationship.

Roughly 50,000 Marylanders are now banned from gun ownership because of a history of mental illness. Under the bill that O’Malley’s office will support, the roughly 1,100 people committed annually against their will would begin to be added to that roster. The ban on purchasing firearms would be permanent unless a patient is successful in petitioning a court to have it lifted.

The bill would not, however, place any restrictions on more than 50,000 other state residents who at some point during the last three decades have been confined to a state-run facility.

Without an arrest or other extenuating circumstances, Maryland would not begin to screen any of its record-high 92,000 residents now receiving outpatient mental health treatment.

In Virginia, where the broader law has been in effect for over five years, more than 180,000 residents have been banned from buying a gun. Residents of the commonwealth are now almost three times as likely to be precluded from owning a firearm for mental-health reasons as residents of Maryland.

Some Democrats on the Senate Judiciary Committee said they were more inclined to support a bill with a provision like Virginia’s, but several said they still want additional changes and would propose amendments on Thursday.

Changes could also come if the bill reaches the House of Delegates.

Del. Luiz R.S. Simmons (D-Montgomery), who has called O’Malley’s original plan on gun-control and mental health worse than swiss cheese, said the change mirroring Virginia was a good start, but the bill would need further tweaking to get his vote.

He said in a meeting Monday that he had pushed the administration to consider moving in the direction of New York. Simmons, a defense attorney, said he also wants the bill to address an issue he has come across many times in court: Defendants who have a criminal conviction expunged are free afterward to buy firearms.

Simmons said it is not uncommon for a mental-health patient to get a record expunged because of a mitigating illness through a maneuver known as probation before judgment. “I’m not saying they shouldn’t get it, but the burden ought to be on that person to demonstrate they deserve access to a gun,” he said.