A POLICEMAN'S gun left in a bag at a suburban McDonald's is now floating around Sydney's underworld after a man who stumbled across the weapon admitted he sold it.

Benjamin John Aurisch was sentenced to at least a year behind bars for taking the detective's backpack - containing a police-issued Glock, 15 rounds of ammunition, a warrant card and his lunch box - from Mascot McDonald's on April 8. The Malabar man pleaded guilty to possessing a loaded firearm in a public place and possessing a prohibited weapon.

The case took only five months from arrest to conviction, and his arrest was never publicised by NSW Police.

Aurisch led police to the backpack, discarded at a home in Mascot, but the gun was not recovered because he maintained he gave the firearm to a male who "took possession of the these items intending to sell them".

The District Court in Sydney heard the 30-year-old was a frequent visitor to the McDonald's outlet, where "he had a routine of attending ... virtually for six or seven hours per day, asking patrons for money".

But on that particular day he hit the jackpot, finding the Glock among the other items in the discarded backpack.

"(Aurisch) bent down and appeared to look inside the backpack before standing up and walking towards the front doors of the restaurant," Crown documents tendered to the court say.

"(He) looked out the front doors and around the restaurant.

"(He) walked out the front doors of the restaurant and appeared to make a phone call using a mobile telephone ... (then) re-entered the restaurant and went back to the table on two further occasions where he appeared to rummage through the backpack."

CCTV footage revealed Aurisch's movements - he was arrested within three hours of police racing back to the store trying to find the lost bag.

The court heard while Aurisch led them to the bag, "maintaining he didn't know it belonged to police", the Glock and ammunition were never found.

A NSW police spokeswoman said the detective faced "internal disciplinary action".