A metro Atlanta man knew he wouldn't get through metal detectors at the Forsyth County courthouse with a loaded gun, authorities said.

His solution? Bury the gun outside and return for it later.

>> Read more trending news

Deputies watched on court surveillance footage as 23-year-old Sheldon Oliver dug up some gravel outside the courthouse in Cumming and buried a Louis Vuitton bag with his handgun, sheriff’s spokesman Cpl. Doug Rainwater confirmed to AJC.com.

He made it through the metal detector just fine, Rainwater said, but he was arrested shortly after.

Oliver was scheduled to appear in Forsyth County State Court on Sept. 11 for an arraignment on misdemeanor charges of loitering and criminal trespass. That hearing was rescheduled after he was arrested on charges of reckless conduct and carrying a weapon without a license.

When investigators confronted him, deputies also realized Oliver had an active warrant for first-degree burglary in connection with a break-in at an Islamic Center.

Oliver is now jailed on a $25,000 bond, jail records showed.

Rainwater said the sheriff’s office takes no chances with safety at the courthouse. Four years ago, a man identified as a sovereign citizen attacked the Forsyth County courthouse and wounded a deputy before dying in a hail of bullets.

Officials said Dennis Marx drove his SUV through the courthouse lawn, threw out homemade smoke grenades, pepper spray grenades and spike sticks, and was killed when deputies returned fire.