Drug cheats at German sports events could face up to 10 years in jail under a proposed law.
Draft anti-doping legislation that could lead to prison terms for offending athletes, coaches and doctors has been passed by Germany's cabinet.
The draft legislation will go before parliament for approval towards the end of the year.
The draft law foresees prison terms for top athletes, coaches, officials and doctors who are caught using - or are in possession of - forbidden substances.
Athletes could be jailed for up to three years. A prison term of up to 10 years is possible for an offender who endangers "large numbers of people" or exposes someone to the risk of serious injury or loss of life.
The law targets the 7000 athletes from the test pool of the German Anti-Doping Agency as well as foreign athletes who compete at events in Germany.
Amateur athletes will not be affected.
Justice Minister Heiko Maas said firm sanctions in the fight against doping in sport would help Hamburg's bid to host the 2024 Olympic Games.
"An anti-doping law has been argued about in Germany for decades. I am pleased we have now made a breakthrough," he said.
"Athletes who dope are no longer only threatened with a suspension but in the worse case jail."
The German Olympic sports association has, however, voiced reservations, saying the authority of sports federations' own disciplinary bodies could be affected.
Interior Minister Thomas de Maiziere said after years of debate it was time a decision was taken.
"The debate will continue in parliament, and that's what it's there for," he said.