Police said the suspect, 37-year-old Gokmen Tanis, had been taken into custody after an hours-long manhunt and had earlier run-ins with authorities in the Netherlands.
The city was put into lockdown after the shooting, shortly after the morning rush hour, which authorities initially said was an apparent terrorist attack. Police conducted raids in several locations after issuing an image of Tanis and warning the public not to approach him.
But hours after the shooting, the gunman’s motive remained unclear. A prosecutor said it could be for “family reasons” and Turkey’s state-run Anadolu news agency, quoting relatives of the gunman, said he had fired at a relative on the tram and had then shot at others who tried to help her.