"The dead man found around 300m from the scene of the crime after the shooting in the mosque is the suspect," a statement on a police website said.
Two of the three victims -- aged 30, 35 and 56 -- were seriously injured in the attack, which took place shortly after 5:30pm (1630 GMT) near the main train station in Switzerland's financial capital. A third sustained less severe injuries.
Police had identified the suspect only as a man around 30 years old wearing dark clothing and a dark woolen cap who fled the mosque after the attack.