The script was loosely based on the life of Danguolė Rasalaitė, a 16-year-old girl from Lithuania whose case had made headlines in Sweden in 2000. A male acquaintance helped Rasalaitė travel to Sweden with the promise of a job in Malmö. When she arrived, a man referred to as "the Russian," who would become her pimp, took her passport and told her she would have to repay him 20,000 SEK ($2410 USD in 1999; $ today) for travel expenses and she was forced to prostitute herself for the next month. She escaped from the apartment where she was being held in the rough suburb of Arlöv, moved to Malmö and after three months, day after she had been raped by her boyfriend and two other men, on 7 January 2000 jumped from a bridge and died three days later in the hospital. Three letters she was carrying with her unravelled the story. The screenplay was originally supposed to be deeply religious, with Jesus being a prominent character, walking next to Lilja throughout the story. Moodysson wrote the script in Swedish and then had it translated into Russian.