A top court in Germany ruled on Thursday that male chicks can continue to be slaughtered until a test becomes available to determine the sex of the chick while it's still in the embryo.

The Federal Administrative Court ruled that hen breeders can continue to kill the chicks after they hatch — a practice that's resulted in the death of roughly 45 million birds each year.

POLAND'S LEADERS CAMPAIGN TO SAVE WILD COWS FROM SLAUGHTER

The court ruled in a case involving a hatchery specialized in egg-laying hens that killed male chicks because they won't lay eggs and the breed is unsuited to raise for meat.

MASSIVE ORDER FOR 600 CHICKEN FINGERS GOES MISSING

The hatchery was banned from killing the chicks in 2013, but another court then reversed the ban.

Julia Kloeckner, Germany's agriculture minister, opposes the killings, which she told the Rheinische Post "is ethically unacceptable and must be stopped as soon as possible."

Kloeckner said that $9 million had been allocated to find other methods outside of slaughtering the chicks.

CLICK HERE TO GET THE FOX NEWS APP

The federal court on Thursday said a company's economic interests don't constitute a "sensible reason" under animal protection laws for killing the birds, but it said techniques to determine chicks' gender in the egg should soon be available and hatcheries shouldn't be asked to change their practice twice.

The Associated Press contributed to this report.