Jake Heflin with Long Beach fire said the blaze ignited around 1:53 a.m. in the 400 block of Chestnut Avenue.
Police officers who were in the area were flagged down by a resident who informed them of the fire.
One of the officers found two people trapped in a bedroom in an apartment in the rear of the structure. Officials said there were metal security bars on the windows which prevented the two from escaping the flames.
That officer used a 4-by-4 piece of wood to pry the bars open and helped the residents, a man and a woman, escape.
The two were transported to a local hospital to be treated for life threatening injuries. They were listed in critical condition.
All of the apartment units in the two-story building share one gas meter, which had to be shut down. Also, the structure already had no power due to an outage caused by an underground electrical fire in the area Wednesday night.
The Red Cross was assisting the residents about 30 people.
The cause of the apartment fire is under investigation.