Gokmen Tanis, a 37-year-old Turkish man, was found several hours after the attack in a building about two miles (3km) from the scene.
Authorities said the attacker's motive was unclear.
The incident sparked a city-wide manhunt and the closure of schools.
At about 10:45 local time (09:45 GMT), police were called to reports of a shooting on board one of the city's trams at the 24 Oktoberplein junction.
One witness told local media that "a man started shooting wildly".
Several of the injured are in a critical condition.