TALLAHASSEE, Fla. — A Florida law restricting what doctors can tell patients about gun ownership was deemed to be constitutional Friday by a federal appeals court, which said it legitimately regulates professional conduct and doesn’t violate the doctors’ First Amendment free speech rights.

The ruling by the 11th U.S. Circuit Court of Appeals in Atlanta overturned a previous decision that had blocked the state from enforcing the law.

The 2011 law, which had become popularly known as “Docs vs. Glocks,” was challenged by organizations representing 11,000 state health providers, including the Florida chapters of the American Academy of Pediatrics and the American Academy of Family Physicians

Doctors who break the law could potentially be fined and lose their licenses.

“The act simply codifies that good medical care does not require inquiry or record-keeping regarding firearms when unnecessary to a patient’s care,” states the opinion written by U.S. Circuit Judge Gerald Tjoflat.