Updated

A gunman killed five people and injured at least 20 others early Saturday when he opened fire with an automatic weapon in a cafe in northern Serbia, police said. The suspect was arrested.

The attack occurred at 01:40 a.m. local time (7:40 p.m. ET Friday) in a village close to the town of Zrenjanin, some 30 miles northwest of Belgrade.

A police statement says a man identified only as Z.S. first killed his wife and another woman before randomly shooting at other occupants of the cafe.

Witnesses told Serbia's state TV that the attacker came to the cafe and saw his wife there with a group of friends. He then went home and came back with a gun.

"He just pulled out a gun and started shooting, first into the air," one of the witnesses, Svetozar Manojlovic, said.

"It sounded like firecrackers at first," he said. "Then the guy next to me fell down and others started falling down. It was total chaos."

Serbia's Interior Minister Nebojsa Stefanovic said that the cafe guests eventually managed to grab the weapon from the man's hands when he tried to run away. Police in the vicinity arrived swiftly and caught the suspect, Stefanovic said.

He said that the probable motive was jealousy.

Stefanovic said the automatic weapon was illegal. He appealed to citizens to hand over illegal weapons that many people have following the wars in the Balkans in the 1990s.

"This was completely unexpected," Stefanovic said, speaking in front of the "Makijato" cafe. "There were no signs at all, people tell us that he was completely calm and norma," he said.

The wounded were taken to hospitals in nearby Zrenjanin and Novi Sad. Doctors in Zrenjanin said seven people underwent operation and were in serious condition.