A three-alarm fire caused by a malfunctioning stove affected dozens of units in a New Carrolton apartment building Monday afternoon. (Prince George's County Fire Department)

A three-alarm fire ripped through a New Carrollton apartment building Monday afternoon, leaving nearly a dozen units uninhabitable.

Prince George’s County firefighters responded to the Sutton Walk complex at 5312 85th Avenue around 1 p.m.

According to officials, the fire appears to have started in a rear unit in the garden-style apartment building and spread through the top two floors and attic.

Everyone inside the building was safely evacuated. Utilities were shut off while firefighters battled the blaze.

Officials said it took 50 firefighters about 30 minutes to knock down the flames.

Two firefighters sustained minor burn injuries and were transported to the burn unit at Medstar Washington Hospital Center for treatment. No other injuries were reported.

Fire officials said that a total of 43 apartments were affected by the fire and lack of utilities. At least 11 of those units are uninhabitable due to fire, heat, smoke and water damage.

Officials said the fire was ruled “accidental,” caused by a malfunctioning natural gas stove in a second-floor apartment.

Total fire loss is estimated at $750,000.