Dennis Farina may be able to carry a gun on-screen, but he won't be able to own one in California for several months.

The actor's attorney pleaded no contest on Thursday to a misdemeanor charge of bringing a weapon into a secure area at Los Angeles International Airport. A court commissioner sentenced him to up to two years of probation and ordered him to pay $1,991 in fines, said Los Angeles City Attorney spokesman Frank Mateljan.

While on probation, Farina cannot own or carry a gun, Mateljan said.

A former policeman, Farina was arrested May 11 for having a .22 caliber semiautomatic handgun in his briefcase. He promptly apologized after his release, saying he forgot he had the gun in his baggage.

Farina, 64, did not appear in court Thursday.

Farina has appeared in numerous TV shows and movies, including a three-year stint on "Law & Order" as detective Joe Fontana.

Other charges of carrying a concealed weapon and carrying a loaded firearm were dismissed.