Princess Diana's (search) former lover, who was found drunk and carrying cocaine earlier this year, is a potential danger to public safety who should be barred from keeping weapons, a court was told Thursday.

James Hewitt (search), 46, has appealed the revocation of his firearms license.

Lawyers for the police told Blackfriars Crown Court in London that Hewitt was drunk and had cocaine in his pocket when he was detained July 21 outside a restaurant with girlfriend Alison Bell.

When police searched his apartment, they found a disassembled shotgun in a case on the floor — a breach of his license, which stipulated it should have been kept in a secure cabinet.

"A drunken man with a gun is capable of being very dangerous," said James Rankin, representing the city police commissioner.

He told Justice Charles Byers, who is hearing the appeal with two magistrates, that Hewitt — who became famous for romancing Diana and then cooperating in a book about it — was capable of "irresponsible and uncontrolled behavior."

The hearing was continuing.

Hewitt denies buying drugs, as a witness had told police, saying the cocaine in his possession was just for personal use. He received a warning for carrying the drug.