The man, who was not immediately identified, became involved in a dispute of some sort inside a unit at the complex at 55th Street and Linden Avenue about 8:30 a.m., said Long Beach police Sgt. Rico Fernandez.
Other people at the scene fled, and the man went outside and fired some shots in the air, then went back inside, Fernandez said.
Police evacuated nearby residents and shut down several streets in the area.
The man, who was hiding in a closet, was taken into custody without incident at about 2:30 p.m.
City News Service contributed to this story.