Gunfire rang out near the home of "Lost" star Malcolm David Kelley this morning as cops apprehended a person suspected of breaking into his L.A. area pad ... while Malcolm was inside!!!!

TMZ has learned the L.A. County Sheriff's Dept. received a call from Malcolm -- who plays Walt on the ABC show -- to report a burglary in progress at the actor's home in Bellflower, CA at 9:28 AM.

Sources close to the investigation tell us the bad guy first attempted to knock on the front door of the house -- and when no one answered, the perp tried to break in through the back.

We're told Malcolm heard the noise and immediately called 911.

Whencops arrived to the scene -- we're told the bad guy tried to flee when he heard the sirens. We're told officers fired at least one shotat the suspect outside the home -- but no one was hit.

Eventually, we're told one person was taken into custody -- and is currently being detained.

Cops are still investigating the situation.

TMZ spoke to Malcolm's rep, Dominic Friesen, who tells us, "Malcolm and his family are incredibly grateful that no one was injured during today's incident."