A man has died in hospital after ramming his car into an Ipswich home and setting it ablaze while his former partner and three others were inside.

The 37-year-old man rammed his car into a home in Brookwater on Monday night, before spreading accelerant throughout the house and setting it on fire.

He suffered burns to 95% of his body and died at Royal Brisbane hospital on Tuesday night.

The four people in the home had barricaded themselves in the bathroom during the attack and suffered minor burns but only one woman required treatment at hospital.

Acting Inspector Heath McQueen told the Courier-Mail that the women were lucky to escape the arson attack.

“It’s very lucky they have only suffered minor injuries given the gravity of the situation and what has actually happened and the possible ­intent of the person ­involved,” he said.

“We are very fortunate that we are not standing here today with a much worse situation.’’

Ipswich deputy mayor, Paul Tully, was one of the first to arrive at the blaze, at which point the four occupants – including the 23-year-old ex-partner, a 48-year-old woman and two 18-year-olds – were trapped inside.

“When I arrived the house was engulfed in flames, they were several metres into the air,” Tully said.

• Australian Associated Press contributed to this report