Steven Freeland told state fire investigators that he thought he snuffed out his cigarette when he went to bed around midnight Thursday after watching television at his Edgewood town house.
But investigators believe that smoldering ashes from the cigarette ignited a couch in the living room, setting the home ablaze about an hour later.
The fast-moving fire destroyed the house and damaged four other homes.
Investigators said Mr. Freeland, his children and his fiancee might not have escaped had it not been for his 19-month-old son waking up to the smell of smoke and the sound of crackling flames.
"The people were sound asleep and were unaware there was a fire in the house," Deputy Chief Fire Marshal Rob Thomas said. "Had the child not gotten up, we could have easily had four fatalities.
"A few more minutes, the smoke would have made it difficult to escape," Mr. Thomas said.
The three-story, wood-frame town house in the Edgewater Village development was occupied by Mr. Freeland, 21, his fiancee, Patricia Gleason, 19, and his two sons, 19-month-old Shane and 5-month-old Patrick.
Investigators believe Shane was awakened by the fire, Mr. Thomas said.
Crying, the boy got out of his crib and went to his father's bedroom.
Mr. Freeland comforted the toddler and was taking him back to his crib when he smelled something burning in the house, Mr. Thomas said.
Mr. Freeland discovered the fire in the town house's second-floor living room, Mr. Thomas said.
He then got his sons and Ms. Gleason safely out of the home, shortly before the structure became fully engulfed.
The Freeland's house was equipped with two smoke detectors, but the battery in one was dead and the other detector had not been working properly for about a year, Mr. Thomas said.
About 120 volunteer firefighters from nine fire companies in Harford and Baltimore counties responded to the blaze, Mr. Thomas said.
The four-alarm fire, reported at 1:12 a.m. yesterday, was brought under control about 2 a.m., but firefighters remained at the scene until 6 a.m.
Two firefighters received minor injuries as they fought the fire and were treated at the scene, Mr. Thomas said.
One firefighter burned his hand and another stepped onto a nail.
The fire, ruled an accident by the state fire marshal's office, caused $500,000 damage to the Freeland home and four other town houses in the 1700 block of Judy Way, Mr. Thomas said.
In addition to the Freeland home, the fire caused extensive damage to a neighboring unit.
Three other units were damaged by smoke, water and heat.
The town houses were occupied by nine adults and 10 children, according to the American Red Cross of Harford County.
The Red Cross is assisting the Freeland family with food, clothing and shelter.
The agency gave the family $600 to buy food and clothing, but more help will likely be needed, said Wayne Wigglesworth, the agency's director.
Cash donations for the family can be sent to the Red Cross office located at 122 S. Main St., Bel Air, Md., 21014.