A bipartisan committee of lawmakers from the Senate and the House reached a compromise Wednesday on legislation that would give the Food and Drug Administration greater control over compounding pharmacies. But analysts said it was still unclear whether the law would make drugs safer.

Lawmakers said the bill’s primary function was to help prevent another national health disaster like the meningitis outbreak last year that was traced to a large Massachusetts-based compounding pharmacy, a company that mixes specialty medicine. More than 60 people died and more than 700 were sickened after receiving injections of a contaminated steroid made by the pharmacy, the New England Compounding Co.

The FDA has argued repeatedly that it has limited authority over compounders, which are regulated by state boards of pharmacy, even though many ship drugs across state lines.

The bill’s authors argued that it would give the agency broader powers by placing some compounding pharmacies in a separate category that would require them to behave much like traditional drug manufacturers: to alert the authorities when something goes wrong with their products, to register with the FDA and to allow agency officials into their facilities for inspection, much as traditional drug manufacturers do. But the language of a statement issued late Wednesday by the bill’s authors implied that companies would not be required to be part of the new category, leaving the option open to those compounding facilities “who wish” to join.

If being part of the new group is optional, there will be a reliance on the market to drive demand for products made under the stricter standards, said Allan Coukell, a drug policy expert at the Pew Charitable Trusts. It remains to be seen whether the bill will make compounded drugs safer, he said.

“It will be incumbent on the purchaser — the physician, clinic or hospital — to opt for drugs from FDA-regulated facilities,” Coukell said.

Under current law, compounders are not required to give the FDA access to their books or to allow them on to their production facilities for inspections. About half of all the court orders the agency obtained over the past decade were for pharmacy compounders, although compounders were only a small part of the agency’s regulatory responsibilities.

A Senate staff member with knowledge of the legislation said the goal of the bill was to create an incentive for compounding pharmacies to register with the FDA, even though it is not a requirement for companies to do so.

“If you’re a hospital or a doctor and you have the choice of going to an unregistered facility or one that is registered with the FDA, you’re going to choose the latter,” the staff member said. “It gives hospitals and doctors the certainty that they are getting drugs from an FDA-approved source.”

The bill also sets up a system for tracking drugs, the congressional leaders said in a news release. The system, which they said would help ensure that counterfeit and stolen drugs stay out of the drug supply, includes serial numbers for drugs and an electronic drug-tracing mechanism.