San Bernardino police said 22-year-old Tommy Nelson ran from gang squad officers and dropped a handgun before invading the apartment and ordering the family to leave at about 4:15 p.m.
Tear gas was eventually lobbed into the attic and a police dog was sent in to find him. When the dog found him, they both fell through the ceiling around 10 p.m. Neither was seriously hurt.
Nelson was arrested and booked for investigation of burglary, violating parole, and being a felon in possession of a handgun.
The Associated Press contributed to this story.