In January 2015, a gun assault on the Paris offices of the satirical magazine Charlie Hebdo and an attack on a kosher grocery store killed 17 people.
The ruling, made late on Thursday, came after the Paris prosecutor called for the magazine to be removed from sale.
News of the latest publication led to anger from victims' groups, who accused the magazine of trying to "offend the dignity of the victims and their relatives".
But in an emergency ruling responding to the Paris prosecutor's call for the magazine to be pulled from sale, the court said the pictures were "obscene for showing victims running away to try and escape death or about to die".More news: CBI to investigate extra-judicial killings under AFSPA in Manipur
Nice's Mayor Christian Estrosi also criticised the publication on the eve of the first anniversary of the attack.
The judge did ban the future publication of two particular images either in print or in digital forms.
A French journalist's union, SNJ, condemned the prosecutor's request, warning that it was a curb on press freedom. The magazine defended its decision to publish the images, saying it will defend "the right of the citizens, and first of all the right of the victims, to know what exactly happened during the attack".
He argued that screen shots of the lorry's deadly path had featured recently on TV, and that they were distant images of the scene in which victims could not be identified.More news: Bastille Day: Macron thanks US for WWI support
Victims' organizations denounced the photos as the Riviera city of Nice prepares for the Bastille Day fete and commemoration of those killed July 14, 2016, when a 19-ton truck barreled into celebrating crowds.
Several non-fatal attacks, mainly on police officers throughout the country but mostly on the capital, have also been carried out.
CCTV images of the attack were a controversial subject immediately after the murders.More news: Patrick Rodgers shoots 64, leads by two at the John Deere Classic
- OR kicks WR Darren Carrington off team following DUI arrest
- Carrie Fisher Honored As Disney Legend At D23
- Sudan's Bashir 'suspends sanctions talks with US'
- Multiple reports: Second person arrested in missing men case
- Wal-Mart Stores Inc. (WMT)
- Venus Williams jokes about wishing Serena could play Wimbledon final for her
- Threat of severe thunderstorm has passed in Waterloo region
- Toy Story 4 unpacks new director, teases plot
- Human cases of West Nile Virus confirmed in Nebraska
- Boyd Holbrook's Exit from 'Narcos' Confirmed, Season 3 Teaser Trailer Released