A French court on Tuesday ordered prison terms for eight suspects who were charged in the 2016 terror attack in Nice, AFP reported.

Two men were given the most severe sentences of 18 years behind bars for helping Mohamed Lahouaiej-Bouhlel, a 31-year-old Tunisian resident, prepare an attack that killed 86 people and injured over 450 in the four-minute rampage before he was shot dead by police.

Judges determined that Mohamed Ghraieb and Chokri Chafroud must have known about the attacker's turn to Islamist radicalism and his potential to carry out a terror attack, based on records of phone calls and text messages among the three in the days ahead of the massacre.

Ghraieb, a 47-year-old from the same Tunisian town as Lahouaiej-Bouhlel, and Chafroud, a 43-year-old Tunisian, are also accused of helping to rent the delivery truck. They denied the charges.

Ramzi Arefa, 28 – who has admitted to providing Lahouaiej-Bouhlel with the gun he fired at police without hitting anyone – was handed a 12-year term, though he was not accused of criminal association with a terrorist or of being aware of Lahouaiej-Bouhlel's potential for launching an attack.

Lahouaiej Bouhlel plowed a 19-ton truck into a crowd on the Nice seafront on July 14, 2016, hitting the victims who were watching a fireworks display on the Bastille Day public holiday.

The Islamic State (ISIS) group moved quickly after the attack to claim Lahouaiej-Bouhlel was one of its followers, though investigators have not found any concrete links between the attacker and the jihadists.

The 2016 massacre on the Promenade des Anglais was one of a series of jihadist attacks that rocked France.

The violence began with the January 2015 attacks on the satirical newspaper Charlie Hebdo and the Jewish Hyper Cacher supermarket in Paris. It continued 10 months later with coordinated strikes on the capital's Bataclan concert hall, national stadium and cafe terraces.