A court in the southern city of Pau has approved the takeover of Béatex, which had been placed under judicial proceedings.
The company will now be owned by Toulouse-based Promodis-Cargo. The company known for providing police, fire and army equipment.
Two other companies had been in the bidding to take over the beret producer.
"It's a huge relief because this was the best proposal for us," said Jean René Riard, an employee representative.
Promodis-Cargo has promised to keep on 30 of the 44 employees.
It will also inject an immediate 500,000 euros ($623,000) into the company, with a further 750,000 euros in 2014.
Béatex is based in the south-west town of Oloron-Sainte-Marie. Berets have been produced there since 1840.