Visitors to the Calgary courthouse have to go through a metal detector and other security measures. Visitors to the Calgary courthouse have to go through a metal detector and other security measures. (CBC)

A man who police say tried to sneak an unloaded handgun, ammunition and some marijuana into the Calgary Courts Centre has been charged with several offences.

The man entered the security check-in area of the complex on Monday afternoon and placed his coat and backpack on the X-ray scanning machine, police said on Thursday. He then proceeded through the metal detector.

Alberta sheriffs determined there was a gun in the backpack and called Calgary police.

A search revealed an unloaded, semi-automatic, 9 mm Luger pistol in a box, 50 rounds of ammunition and a small quantity of marijuana.

"When it was revealed, he was immediately asked, 'Is this a gun?' and he replied that he was just carrying it for a friend," said Alberta Sheriff Terry Cote.

A 22-year-old Calgary man has been charged with multiple weapons-related offences, as well as possession of drugs.

Alberta sheriffs displayed some of the items, including knives, that they routinely seize at the security check-in area of the Calgary Courts Centre. Alberta sheriffs displayed some of the items, including knives, that they routinely seize at the security check-in area of the Calgary Courts Centre. (CBC)

"We believe that quite frankly he forgot that he had it in his backpack," said Staff Sgt. Nancy Farmer. "We don't believe he had any intent to utilize that weapon."

Police said the weapon was one of dozens stolen from Wholesale Sports in southeast Calgary.

Earlier this month, a female employee of an outdoor sporting goods store and a male accomplice were charged with weapons trafficking, theft and improper storage of firearms. A police investigation alleges that the pair is linked to the disappearance of almost 60 firearms from the store over the seven months that the woman worked there.

Investigators said at the time that they believed the weapons were destined for the black market. Police recovered two guns stolen from Wholesale Sports in gang or drug-related shootings in Edmonton and Calgary.

Common to find weapons on visitors

Cote said it's common for sheriffs to find knives, brass knuckles, and bear spray on people trying to visit the courthouse.

"Quite often, sometimes people will mention that they carry certain items for their protection," he said. "Some people have it by accident, whether they forgot to take their scissors or tweezers out of their purse or whatnot, whatever before coming in."

If the item is not illegal, visitors are given a choice of putting it in their vehicle or leaving it with someone outside, or having the item seized so they can be permitted to enter.

Confiscated items are held in storage for a short period of time, and then are destroyed, Cote said.