By Adam Easton
BBC News, Warsaw
Polish MPs passed the legislation in September
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.
The Polish law was drafted following a case last year in which a 45-year-old man repeatedly raped his daughter and fathered two children by her.
The law has been criticised by human-rights groups, but it enjoys widespread public support, with one survey saying close to 80% of people here support the measure.