PARIS — France was punished on Thursday for not taking proper care of its hamsters.

The Court of Justice in Luxembourg, the European Union’s highest court, ruled Thursday that France had failed to protect the Great Hamster of Alsace, sometimes known as the European hamster, the last wild hamster species in Western Europe. If France does not adjust its agricultural and urbanization policies sufficiently to protect it, the court said, the government will be subject to fines of as much as $24.6 million.

The Great Hamster, which can grow up to 10 inches long, has a brown-and-white face, white paws and a black belly. There are thought to be about 800 left in France, with burrows in Alsace along the Rhine. That is an improvement: the number had dropped to fewer than 200 four years ago, according to figures from the European Commission, which brought the lawsuit in 2009.