Polish President Lech Kaczynski has signed a law making chemical castration compulsory for adults who rape children or immediate family members.
The introduction of the law means that Poland is now the only country in Europe where certain sex offenders will be forced to undergo the treatment.
Prime Minister Donald Tusk proposed the law in the wake of several high-profile paedophile cases.
The practice has been tried elsewhere but usually on a voluntary basis.
According to its politicians, Poland now has the toughest legislation towards paedophiles in Europe.
Under the law, adults convicted of raping a child under the age of 15 or committing incest will be forced upon release to take drugs to reduce their libido - a practice commonly referred to as chemical castration.
Other European countries have experimented with the practice, which can produce unpleasant side effects such as breast growth, but only as a voluntary option to try to prevent people from re-offending.