A gunman who shot three worshippers at a mosque in Zurich on Monday evening was a 24-year-old Swiss man with Ghanaian roots and no apparent links to Islamist radicalism, police have said.

The suspect, whom they did not identify by name, is thought to have killed a man in Zurich on Sunday. On Monday he stormed into an Islamic centre near the main train station and opened fire on people praying, wounding three men.

His body was found nearby soon afterwards, and police said he appeared to have shot himself. The condition of the three men shot at the mosque was said to be improving on Tuesday.

“He is Swiss and we don’t know anything about the motives,” Christiane Lentjes Meili, head of criminal investigations for the Zurich cantonal police, said of the gunman.

She said the man’s last run-in with the law had been for bike theft seven years ago, and he had quit his job in a shop on Friday.

There were indications that he had taken an interest in occult sciences, Lentjes Meili said. He had a permit for the gun.

He seems to have been acquainted with the man killed on Sunday, who had South American roots and whose body was left in a playground in Zurich.

Onder Gunes, a spokesman for the Federation of Islamic Organisations in Switzerland, said before the shooter’s background became known: “All Muslims are of course shocked that people praying came under fire.

“This would be equally shocking if done by a Muslim, Christians, Hindus or any other religious group. We all have to stand together for peace. This cannot be allowed to escalate.”