An image posted to Twitter by South African police shows firearms seized in the operation on Saturday.
CNN  — 

Five people have been killed and six hospitalized after gunmen took hostages at a church in South Africa on Saturday, police said.

It was unclear how many hostages were in the church at the time, but all have been freed, according to the South African Police Service. They have arrested 40 suspects in relation to the attack at the International Pentecostal Holiness Church in Zuurbekom, northwest of Pretoria.

Of those who died, four were found shot and burned in a car and the fifth, a security guard, was also shot in his car while responding to the incident. Police officers were among those hospitalized with injuries.

More than 34 firearms, including rifles, short guns and pistols, were seized by police.

“I am certain that the speedy response by the joint security forces has averted what could have been a more severe blood bath,” said National Commissioner of Police General Khela John Sitole in a statement.

“It is rather unfortunate that such an incident takes place during a time when South Africa is being plagued by a deadly virus and violent crimes,” Sitole added.

Police responded to reports of a shooting and siege at the church at 3 a.m. (9 p.m. ET).

A group of armed people came into the church and allegedly attacked people inside indicating “they were coming to take over the premises,” a police statement said.

Police added they are investigating the possibility the attack may have been motivated by an internal feud between conflicting parties of the church.