A Swiss national of Ghanaian heritage has been identified as the gunman behind Monday's attack on a mosque frequented by Somalis in Zurich.

The still unnamed individual's body was found apparently after he killed himself on Tuesday after his attack that shocked a city that has been largely peaceful for years.

According to top police officials in the city, the young man had a criminal record from a theft three years previously and had also been linked with the recent stabbing and killing of a Chilean friend after an argument.

"There's no indication of any kind of terrorist connection to (the radical Islamic State group), or an Islamic radicalization of the suspect," Zurich state criminal police chief Christiane Lentjes Meili said of the mosque shootings.

"It became quickly clear that the person killed himself," Lentjes Meili added.