A 29-year-old man has been charged after he allegedly fired a gun outside an Illawarra police station in a bizarre incident overnight.

Police say the Dapto man walked into the police station and handed himself in immediately after the shooting, which was allegedly carried out in full view of police.

Lake Illawarra Police Station. Credit:Illawarra Mercury

The man was arrested and charged with firing a gun in a public place and possessing an unauthorised firearm following the incident outside Lake Illawarra Police Station on Pioneer Drive.

Lake Illawarra Duty Officer Acting Inspector Paul Brodie said the incident occurred just after 9pm on Thursday in view of police and a member of the public.