The main suspect in the Utrecht tram shooting that left three people dead has confessed to the attack, prosecutors have said.

Gokmen Tanis told investigators he was acting alone during Monday’s incident, which saw the Dutch city go into lockdown.

The attack is being investigated as terror related although, in its statement, the public prosecutor's office declined to offer any light on the 37-year-old’s motives.

“The suspect this morning confessed the criminal acts he is charged with," it said following a closed hearing on Friday.

Tanis, an Utrecht resident with a long criminal record, was arrested hours after the shooting and was held on charges including multiple murder or manslaughter with terrorist intent. He did not know any of those who were killed – which included a teenage girl.

Utrecht shooting: Man opens fire on passengers in Dutch tram attack Show all 30 1 /30 Utrecht shooting: Man opens fire on passengers in Dutch tram attack Utrecht shooting: Man opens fire on passengers in Dutch tram attack Special Police Forces inspect a tram, after a shooting took place on a tram at the 24 Oktoberplace in Utrecht EPA Utrecht shooting: Man opens fire on passengers in Dutch tram attack This image made available from the Twitter page of Police Utrecht shows an image of 37-year-old Gokman Tanis who police are looking for in connection with the tram shooting incident Police Utrecht/AP Utrecht shooting: Man opens fire on passengers in Dutch tram attack Emergency services stand at the 24 Oktoberplace in Utrecht, on March 18, 2019 where a shooting took place. - Several people were wounded in a shooting on a tram in the Dutch city of Utrecht on March 18, police said, with local media reporting counter-terrorism police at the scene. "Shooting incident... Several injured people reported. Assistance started," the Utrecht police Twitter account said. "It is a shooting incident in a tram. Several trauma helicopters have been deployed to provide help." (Photo by Robin van Lonkhuijsen / ANP / AFP) / Netherlands OUTROBIN VAN LONKHUIJSEN/AFP/Getty Images ROBIN VAN LONKHUIJSEN AFP/Getty Utrecht shooting: Man opens fire on passengers in Dutch tram attack Police, including heavily armed officers, flooded the area after the shooting Monday morning on a tram at a busy traffic intersection in a residential neighborhood AFP/Getty/Twitter/michadrost Utrecht shooting: Man opens fire on passengers in Dutch tram attack Dutch counter terrorism police use a robot as they prepare to enter a house AP Utrecht shooting: Man opens fire on passengers in Dutch tram attack Dutch counter terrorism police prepare to enter a house after a shooting incident in Utrecht AP Utrecht shooting: Man opens fire on passengers in Dutch tram attack Forensic police search the interior of the tram EPA Utrecht shooting: Man opens fire on passengers in Dutch tram attack An armed Police officer patrols at a train station in Rotterdam EPA Utrecht shooting: Man opens fire on passengers in Dutch tram attack Special Police forces inspect a tram AFP/Getty Utrecht shooting: Man opens fire on passengers in Dutch tram attack In this handout picture from the twitter account of @michadrost, special police forces patrol in Utrecht after a shooting near the 24 Oktoberplace, on March 18, 2019. - Three people were killed and nine injured in a shooting in the Dutch city of Utrecht, the mayor said today, adding that authorities were working on the basis of it being a terrorist attack. Dutch police released a picture of Turkish-born Gokmen Tanis they are hunting over a shooting on a tram in Utrecht today. (Photo by @michadrost / various sources / AFP) / RESTRICTED TO EDITORIAL USE - MANDATORY CREDIT "AFP PHOTO / Twitter / @michadrost" - NO MARKETING NO ADVERTISING CAMPAIGNS - DISTRIBUTED AS A SERVICE TO CLIENTS --- NO ARCHIVE ---@MICHADROST/AFP/Getty Images @MICHADROST AFP/Getty/Twitter/michadrost Utrecht shooting: Man opens fire on passengers in Dutch tram attack Police officer with a service dog Reuters Utrecht shooting: Man opens fire on passengers in Dutch tram attack According to the the Dutch Police, several people have been injured and the perpetrator is still at large EPA Utrecht shooting: Man opens fire on passengers in Dutch tram attack Members of the military police stand guard around the Binnenhof, The Hague AFP/Getty Utrecht shooting: Man opens fire on passengers in Dutch tram attack Rescue workers install a screen AP Utrecht shooting: Man opens fire on passengers in Dutch tram attack Several people were wounded on a tram in the Dutch city of Utrecht Sky News Utrecht shooting: Man opens fire on passengers in Dutch tram attack Police forces walk near a tram AFP/Getty Utrecht shooting: Man opens fire on passengers in Dutch tram attack Police are seen after a shooting in Utrecht, Netherlands, March 18, 2019. REUTERS/Piroschka van de Wouw PIROSCHKA VAN DE WOUW Reuters Utrecht shooting: Man opens fire on passengers in Dutch tram attack Police secure the site Reuters Utrecht shooting: Man opens fire on passengers in Dutch tram attack Members of the military police arrive to heighten security around the Binnenhof, The Hague EPA Utrecht shooting: Man opens fire on passengers in Dutch tram attack Local media reported counter-terrorism police at the scene AFP/Getty Utrecht shooting: Man opens fire on passengers in Dutch tram attack A body lays next to a tram as emergency services attend the scene AP Utrecht shooting: Man opens fire on passengers in Dutch tram attack Armed police at the scene EPA Utrecht shooting: Man opens fire on passengers in Dutch tram attack epa07446531 Emergency services at the scene where a shooting took place at the 24 Oktoberplace in Utrecht, The Netherlands, 18 March 2019. According to the the Dutch Police, several people have been injured in a shooting on a tram in the central Dutch city of Utrecht. EPA/ROBIN VAN LONKHUIJSEN ROBIN VAN LONKHUIJSEN EPA Utrecht shooting: Man opens fire on passengers in Dutch tram attack Emergency services attend the scene of a shooting in Utrecht, Netherlands, Monday March 18, 2019. Police in the central Dutch city of Utrecht say on Twitter that "multiple" people have been injured as a result of a shooting in a tram in a residential neighborhood. (Martijn van der Zande via AP) Martijn van der Zande Martijn van der Zande/AP Utrecht shooting: Man opens fire on passengers in Dutch tram attack "Shooting incident... Several injured people reported. Assistance started," the Utrecht police Twitter account said. "It is a shooting incident in a tram. Several trauma helicopters have been deployed to provide help." EPA Utrecht shooting: Man opens fire on passengers in Dutch tram attack Police forces stand near a tram at the 24 Oktoberplace in Utrecht, on March 18, 2019 where a shooting took place. - A gunman who opened fire on a tram in the Dutch city of Utrecht on March 18, injuring several people, is on the run, police said. Police only spoke of one gunman but did not rule out the possibility there might be others, the ANP news agency quoted police as saying. (Photo by Robin van Lonkhuijsen / ANP / AFP) / Netherlands OUTROBIN VAN LONKHUIJSEN/AFP/Getty Images ROBIN VAN LONKHUIJSEN AFP/Getty Utrecht shooting: Man opens fire on passengers in Dutch tram attack Emergency services attend the scene of a shooting in Utrecht, Netherlands, Monday March 18, 2019. Police in the central Dutch city of Utrecht say on Twitter that "multiple" people have been injured as a result of a shooting in a tram in a residential neighborhood. (Martijn van der Zande via AP) Martijn van der Zande Martijn van der Zande/AP Utrecht shooting: Man opens fire on passengers in Dutch tram attack Police forces and emergency services stand at the 24 Oktoberplace in Utrecht, on March 18, 2019 where a shooting took place. - Several people were wounded in a shooting on a tram in the Dutch city of Utrecht on March 18, police said, with local media reporting counter-terrorism police at the scene. "A shooting occurred on the 24 Oktoberplein in Utrecht... Multiple people have been injured. The surrounding area has been cordoned off and we are investigating the matter," Utrecht police said on Twitter. (Photo by Robin van Lonkhuijsen / ANP / AFP) / Netherlands OUTROBIN VAN LONKHUIJSEN/AFP/Getty Images ROBIN VAN LONKHUIJSEN AFP/Getty Utrecht shooting: Man opens fire on passengers in Dutch tram attack In this image taken from the Twitter page of Lilian Bruigom, emergency services attend the scene of a shooting in Utrecht, Netherlands, Monday March 18, 2019. Police in the central Dutch city of Utrecht say on Twitter that "multiple" people have been injured as a result of a shooting in a tram in a residential neighborhood. (Lilian Bruigom via AP) Lilian Bruigom Lilian Bruigom/AP Utrecht shooting: Man opens fire on passengers in Dutch tram attack epa07446481 Emergency services at the 24 Oktoberplace where a shooting took place in Utrecht, The Netherlands, 18 March 2019. According to the the Dutch Police, several people have been injured in a shooting on a tram in the central Dutch city of Utrecht. EPA/ROBIN VAN LONKHUIJSEN ROBIN VAN LONKHUIJSEN EPA

Investigators say that a note found in a getaway car also indicates an extremist motive.

They have asked a forensic psychiatry and psychology institute to carry out a personality test on him.

A 40-year-old man who was detained a day after the shooting because Tanis was arrested at his home has been released without charge after no evidence was found that he helped in the shooting, prosecutors said.

Gokmen Tanis, who police said had confessed to the attack (AFP/Getty Images)

The confession comes as mourners prepared on Friday for a silent march through Utrecht to remember the attack's victims, which included a 19-year-old woman from the town of Vianen and men aged 28 and 49, both from Utrecht.

Support free-thinking journalism and attend Independent events