Five other firefighters were injured and taken to hospitals, where they were being treated for chest and leg injuries.
The fire began shortly after noon at Bhojan, an Indian restaurant, according to a statement released by the Fire Department, and soon engulfed the adjacent Southwest Inn, a motel on a stretch of U.S. Route 59 called the Southwest Freeway.
Towering flames leapt into the sky, and dark smoke hung heavily over the building, whose front section appeared to have collapsed, according to footage broadcast by a Fox station in Houston.
It was not clear on Friday evening how the fire began, but Martha Lopez, a desk clerk at the Southwest Inn, told The Houston Chronicle that an employee of the restaurant where the fire was believed to have begun had burst into the lobby to warn motel guests and employees. She and the restaurant worker then began to evacuate the hotel, she said.
Terry Garrison, the Houston fire chief, said the four firefighters who died had been looking for people they thought were trapped in the burning building.
Jeff Caynon, president of the Houston Professional Fire Fighters Association, told The Associated Press that he believed the firefighters — whom the Fire Department identified as Matthew Renaud, 35; Robert Bebee, 41; Robert Garner, 29; and Anne Sullivan, 24, a probationary firefighter who had graduated from the academy in April — had been caught in a roof collapse.
"I don't know if that was folks outside next to the structure or inside when it collapsed, but the collapse is going to be the cause," Mr. Caynon said after visiting firefighters at Memorial Hermann Hospital in Houston.
"The loss of life is believed the single worst in the history of the 116-year-old Houston Fire Department," said Janice Evans, a spokeswoman for Mayor Annise Parker of Houston.
A spokeswoman for the Houston Field Division of the Bureau of Alcohol, Tobacco, Firearms and Explosives said members of its arson explosives task force had joined the investigation. Some of them had also responded to the deadly explosion at a fertilizer plant in West, Tex., in April.
The spokeswoman said she did not know if there was any reason to believe arson had been involved in the motel fire and added that the agency was responding because it was a large commercial fire.
The fire snarled traffic into and out of Houston on a busy Friday afternoon.
Manny Fernandez contributed reporting.