BERLIN (AP) — A court in western Germany has sentenced a pharmacist to 12 years in prison for diluting cancer drugs on a massive scale in order to finance his luxury lifestyle.

In its ruling Friday, the Essen regional court said defendant Peter S. had manipulated at least 14,000 drugs, the quality of which was “not insignificantly” diminished. The offenses took place in nearby Bottrop between 2012 and 2016.

Prosecutors accused the 48-year-old, whose surname wasn’t provided for privacy reasons, of harming at least 27 patients, although earlier estimates put the number far higher.

The defendant allegedly obtained more than 50 million euros ($58 million) through the fraud, and used the money to build a villa with a large water slide.

He was arrested in November 2016 after pharmacy staff blew the whistle.