A federal appeals court is upholding a Florida law restricting what doctors can discuss about guns with their patients.

A panel of judges on the 11th U.S. Circuit Court of Appeals in Atlanta on Friday overturned a decision from a lower court that found the law unconstitutional.

The appeals court called the law a "legitimate regulation of professional conduct" and that the limits imposed by it were "incidental."

The law passed in 2011 was declared unconstitutional by U.S. District Judge Marcia Cooke, who agreed with doctors and gun control advocates that it violated the free speech rights of Florida physicians.

Attorneys representing physicians said the law censored speech because doctors would not risk a potential loss of license or fines up to $10,000 for violating it.