A man in South Korea set fire to his own apartment before stabbing neighbours as they tried to flee the building, killing at least five and injuring 13 others.

A 12-year-old girl and a grandmother were among the dead, police in the southern city of Jinju said, while the death toll could continue to rise with a number of the injured in critical condition.

Police have arrested a 42-year-old suspect, who has been identified only by his last name An. According to Korea Times, An was detained after a confrontation with police at the apartment building in which blanks, live rounds and finally a Taser were used.

The fire started after the attacker sprayed petrol inside his home and ignited it at around 4.30am on Wednesday. He then went outside and shouted “Fire!”, seemingly to flush out other residents of the building, police said.

The attacker then started stabbing neighbours in the emergency stairwell, using what police described as a “lethal tool”.

One resident was able to call emergency services, and police said they detained the man at 4.50am. Some residents also suffered from smoke inhalation, before firefighters extinguished the blaze around 20 minutes later.

Police said the man was not intoxicated at the time of the attack, and that he told officers he committed the crime due to a grievance over unpaid wages, according to the Yonhap news agency.

But a spokesman for Jinju police told reporters: “The suspect kept changing his story and it didn't make any sense. He admitted to the arson and killing but refused to disclose the cause of his crime.”

An was a day labourer who was not due any wages, the spokesman said, and also received government welfare support.

He had lived alone at the apartment block since 2015 and previously had a number of run-ins with his neighbours, including an incident where he sprayed soy sauce and vinegar on an apartment door in a row over noise.