At least three people were killed and at least four injured in Dallas on Thursday after a construction crew damaged a gas line and an apartment building burst into flames, officials said.

Two women and a child, whose gender had not been confirmed, died in the fire, Jason Evans, a spokesman for the Dallas Fire-Rescue Department, said at a news conference on Thursday night. It was possible that crews would find more victims, he said.

One of the injured people was in critical condition but stable, and two others were expected to be released from the hospital by the end of the night, Mr. Evans said.

At least one person had gone to a hospital on their own, with minor injuries, he said.

“This was enormous,” Mr. Evans said of the fire. “You can just see by the result of what we all saw when we pulled up on the scene.”

Mr. Evans said that about 35 to 40 percent of the debris had been searched by hand, and some of the debris would need to be excavated.

“We just have to keep searching,” he said.

An assistant chief of the Dallas Fire-Rescue Department, James Russ, said at an earlier news conference that dispatchers received a call before 1 p.m. about a gas leak at a building in the Oak Cliff neighborhood, southwest of downtown Dallas.

The fire was quickly upgraded to a five-alarm from a two-alarm, Chief Russ said.

“It continued to escalate,” he said.

In another news conference, Deputy Chief Mark Berry said that fire crews had been on their way to the gas leak when an explosion happened at the building.

Within a couple of hours, the fire had been contained, and responders were searching through the rubble, as well as using a drone to survey the area, Chief Russ said.

Fire crews had shifted from rescue operations into recovery, and they were expected to be at the scene through Friday, the department said.

It was not immediately clear how many people had been displaced by the fire. Aerial footage showed that much of the building appeared to have been destroyed. Black smoke could be seen more than 12 miles away on Thursday afternoon.

“We are going to do every single thing we have to do, and that we need to do, to make sure that every affected family by this tragedy gets what they need,” Mayor Eric Johnson of Dallas said at an earlier news conference.

Atmos Energy, a gas company that serves the Dallas area, said in a statement that an unaffiliated construction crew had damaged a natural gas pipeline. The damage occurred around the time the building burst into flames.

It was unclear what company or agency had contracted the construction crew.

Ghassan Khankarli, the director of the Dallas Department of Transportation and Public Works, said at a news conference that city crews had not been working in the area, and that the explosion was under investigation.

Atmos Energy crews were on hand to help the fire department and emergency personnel, and natural gas service had been turned off in the immediate area, the company said.

The Dallas police asked residents to avoid the area.

Kimberly Bizor Tolber, the city manager, said that a reunification center had been set up at the nearby W.H. Adamson High School.