A Pakistani asylum seeker suspected of ploughing a lorry into a Berlin Christmas market was released Tuesday for lack of evidence, prosecutors said.
The militant Islamic State has claimed responsibility for the attack.
“The accused, detained over the attack on the Berlin Christmas market on December 19, 2016, was let go on this evening on the orders of the federal prosecutor,” his office said in a statement.
Authorities identified the man earlier as a Pakistani asylum seeker.
“The forensic tests carried out so far did not provide evidence of the accused's presence during the crimes in the cab of the lorry."
German authorities had earlier said that the Pakistani asylum seeker may not be the right man, sparking fears the real killer could be on the run.
As the shellshocked German capital reeled from the country's deadliest attack of recent years, doubts emerged over whether the man detained overnight actually committed the atrocity.
Berlin's police chief, Klaus Kandt, said “we may have a dangerous criminal in the area”, and announced that security would be boosted while urging “heightened vigilance”.
Twelve people were killed and almost 50 wounded when the truck tore through the crowd Monday, smashing wooden stalls and crushing victims, in scenes reminiscent of July's deadly attack in the French Riviera city of Nice.
The mangled truck came to a halt with its windscreen smashed, a trail of destruction and screaming victims in its wake, with Christmas trees toppled on their side, days before the country's most important festival.
Chancellor Angela Merkel -- who visited the scene of the carnage for a minute's silence and then joined a memorial service in the adjacent Kaiser Wilhelm Memorial Church - labelled the deadly rampage a likely “terrorist” attack.
Merkel said that, if it was confirmed that the killer had been part of the country's recent huge refugee influx, this would be “particularly sickening in relation to the many, many Germans who are involved every day in helping refugees”.
Interior Minister Thomas de Maiziere had earlier said the top suspect was a Pakistani man who had arrived via the so-called Balkan route last New Year's Eve and was staying at a Berlin refugee shelter.
De Maiziere added however that the suspect had insisted he was innocent and had not surfaced on any terror watch lists.
Neither the militant Islamic State (IS) group nor other extremists immediately claimed the attack, said de Maiziere, who vowed those responsible would be hunted down.
The Polish-registered vehicle, which was loaded with steel beams, had cut a bloody swathe of 60-80 metres (yards) into the market in the once-divided city's inner west.
At least six of those killed were German citizens, authorities said, while countries from Israel to Spain said their nationals were among those injured in the busy tourist spot.
A Polish man, killed with an gunshot, was found on the truck's passenger seat, said de Maiziere. He was believed to be the vehicle's registered driver.
The Polish owner of the lorry, Ariel Zurawski, confirmed Monday that the driver -- his 37-year-old cousin - was missing, telling AFP: “We don't know what happened to him ... I've known him since I was a kid. I can vouch for him.”
Survivors recounted harrowing stories of near misses and carnage as festive partying turned to death and destruction in seconds.
Briton Emma Rushton was enjoying a glass of mulled wine when the Christmas scene was shattered by a loud crash and screams.
“We heard a really loud bang and saw some of the Christmas lights to our left starting to be pulled down,” she told Sky news.
“Then we saw the articulated vehicle going through people and through the stalls and just pulling everything down, and then everything went dark.”
'Free way of life'
German flags flew at half-mast Tuesday and mourners placed flowers and candles at the site. Berlin's landmark Brandenburg Gate was to be lit in the German colours black, red and gold in honour of the victims at dusk on Tuesday.
The government declared that the city's 60-odd Christmas markets -- after a one-day voluntary stoppage out of respect for the victims - should continue because “we must not let our free way of life be taken from us”.
Europe has been on high alert for most of 2016, with bloody jihadist attacks striking Paris and Brussels. Germany also suffered two attacks in July in the southern state of Bavaria committed by asylum seekers and claimed by the IS group.
An axe rampage by an Afghan or Pakistani man on a train wounded five people, and a suicide bombing by Syrian asylum seeker left 15 people injured six days later.
The arrival of 890,000 refugees last year has polarised Germany, with critics calling the influx a serious security threat.
Marcus Pretzell of the anti-immigration Alternative for Germany party labelled the Christmas market victims “Merkel's dead”.
The attack in Berlin comes five months after Tunisian Islamist extremist Mohamed Lahouaiej Bouhlel ploughed a truck into a crowd on the Nice seafront, killing 86 people.
President Francois Hollande said France was facing a “high level of threat” following the Berlin bloodshed.
The United States also condemned an apparent “terrorist attack”.