Police had earlier launched a huge manhunt for Gokmen Tanis, 37, issuing a picture of the suspected gunman and warning the public not to approach him following the attack, in which five other people were wounded.
Mosques and schools were closed across the Netherlands' fourth-largest city following the bloodshed, before heavily armed officers surrounded a building and arrested him.
Dutch authorities said they were still investigating a likely terrorist motive for the shooting but Prime Minister Mark Rutte said they "cannot exclude" other motives, including a family dispute.
"We have just heard that the suspect we are looking for has been arrested," Utrecht police chief Rob van Bree told a dramatic press conference seconds after being handed a piece of paper with news of the arrest.
The city's mayor Jan van Zanen told the same news conference it was a "black day for Utrecht", while prosecution officer Rutger Jeuken said that "it looks like what we are dealing with is a terrorist motive".
The drama began when gunfire broke out on a tram near the 24 Oktoberplein square, sending people fleeing from the tram and triggering a huge police response.
One witness told broadcaster NOS they saw an injured woman running out of the tram with blood on her hands and clothes who then fell to the ground.
"I brought her into my car and helped her. When the police arrived, she was unconscious," the witness, who was not named, told the broadcaster.
A body covered in a white sheet could later be seen lying on the tram tracks.
Police then launched a massive manhunt during which the suspected gunman is believed to have carjacked a Renault Clio before being arrested about seven hours later, around three kilometres from the attack site.
Three dead, nine injured in Dutch tram shooting
Security forces were on high alert at airports and other government buildings following the attack, which came just days after 50 people were killed at mosques in New Zealand in a rampage by an alleged white supremacist.
Dutch national counter-terrorism chief Pieter-Jaap Aalbersberg said authorities had lowered the terror threat in Utrecht one notch from the top level after "the arrest of the main suspect for the shooting".
Rutte said afterwards that the Netherlands would "never give way to intolerance".
"There are many questions and rumours," he told a news conference in The Hague. "What the motive is, terrorist or other, we don't yet know, but we can't exclude anything."
Ordering flags to be flown at half-mast on Wednesday, Rutte added that a "sense of horror and disbelief prevails over the terrible events of today."
Provincial elections that will determine the make-up of the Dutch senate will still go ahead on Wednesday, Rutte said. Political parties halted campaigning on Monday because of the attack.
As the focus turned to the alleged attacker, Turkish President Recep Tayyip Erdogan said his country's intelligence agency was "looking into the matter", without providing further detail.
"Some say it is a family matter, some say it is a terror attack ... Our intelligence agency is looking into the matter. I haven't talked to our intelligence chief yet", Erdogan told Ulke TV.
The suspect's father, Mehmet Tanis, said his son "must be punished" if found responsible, Turkey's DHA agency quoted him as saying.
He said he had lost contact with his son having returned to his homeland in 2008 after divorcing his wife, DHA reported. She remained in the Netherlands with Gokmen.
Dutch police said Gokmen Tanis was known to them while NOS reported that he was in court in a rape case two weeks ago.
The Netherlands has been largely spared the kind of attacks which have rocked its closest European neighbours in the past few years, but there has been a series of recent scares.
US Secretary of State Mike Pompeo offered his sympathies over the attack as he addressed a business event in his home state of Kansas co-hosted with The Netherlands.
"America stands with you. We will continue to do all we can to help you in this terrible time of tragedy," said Pompeo, who is due to attend an entrepreneurship summit in The Hague in June.
European Commission chief Jean-Claude Juncker said the EU "stands side by side with the Netherlands and its people during these difficult times."
British Foreign Secretary Jeremy Hunt said it was "hugely concerning news of a gunman opening fire on a tram in Utrecht, no doubt with innocent people just getting on with their day."
In August, a 19-year-old Afghan with a German residence permit stabbed and injured two American tourists at Amsterdam's Central Station before being shot and wounded.
In September, Dutch investigators said they had arrested seven people and foiled a "major attack" on civilians at a big event in the Netherlands.
In June, two terror suspects were arrested while close to carrying out attacks including at an iconic bridge in Rotterdam and in France, prosecutors said.
COMMENTS
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ