The ban, which revolved around the use of a certain coolant, had flared into an international row.
The Council of the State said registrations of certain A, B and CLA-class models, frozen since June, should be resumed in two days.
"It does not appear that if these cars are put on the road in France...they will pose a serious threat to the environment," the ruling said, ordering the government to pay Mercedes France €3,000 in damages.
The court said the decision had cost Mercedes France dear affecting 60 percent of its sales in the country and 40 percent of its earnings. A total of 4,500 vehicles had been hit by the ban.
Mercedes welcomed the ruling saying it "re-established an equilibrium in competition among European carmakers."
France's environment ministry had initiated the move in June, saying the cars use an air conditioning refrigerant the European Union believes emits excessive greenhouse gases.
Mercedes-Benz owner Daimler, which appealed against the ban, has insisted on sticking with an older coolant as it claims studies have shown that the new liquid catches fire more easily and puts cars at a greater risk of explosion in a crash.
Since January 1st, European Union rules demand that car makers use a cleaner refrigerant, deemed less polluting than older products.
Daimler says it will continue with the older product with the hope that "in the next few years" a better version will be available.
The makers of the new coolant reject Daimler's claims but in Germany, the auto giant was given special permission to keep using the older gas.
Japan's Toyota recently said it will not use the new coolant in its Prius Plus, Lexus, GS and GT86 models sold in Europe. But Daimler says no country besides France has raised an objection to the continued use of the older coolant.