An automatic braking system fitted to the truck used in the Christmas market terrorist attack in Berlin prevented the vehicle from ploughing further into the crowds and averted even worse carnage, German authorities said on Thursday.

Anis Amri, the 24-year-old Tunisian asylum seeker who allegedly carried out the attack, killed 12 people and injured 48 others when he rammed the lorry into a Christmas market in the German capital on December 19.

The 40-tonne truck was halted by the automatic braking system, bringing it to a standstill after about 250ft and “preventing even worse consequences,” said Frauke Koehler, a spokeswoman for German prosecutors.

The system, adopted by EU countries in 2012, kicks in when it senses a collision.

The truck used in the Bastille Day terrorist attack in Nice in July was older and not equipped with the advanced braking system. Mohamed Lahouaiej Bouhlel, the man behind the Nice attack, was able to drive more than a mile along the Promenade des Anglais, killing more than 80 people and injuring hundreds, before being shot dead by police.

There had been speculation that the Berlin lorry attack had been brought to a halt by the heroic actions of its Polish driver, whose vehicle was hijacked a few hours before.