A vulnerable girl was "raped and abused by multiple men" from a young age, a jury heard.
The victim was "deliberately targeted" for sex throughout her childhood in Huddersfield, Leeds Crown Court heard.
The prosecution alleges Mohammed Akram, 33, and Usman Khalid, 31, took the girl, who cannot be named for legal reasons, out of the children's home where she was living to abuse her.
Both men have pleaded not guilty to all charges against them.
Mr Akram of Springdale Street, is accused of five counts of rape, sexual assault, abducting a child and trafficking for sexual exploitation.
Mr Khalid, of Brook Street, is facing sexual assault and child abduction charges.
Opening the trial, prosecutor Richard Wright QC told the jury a number of the allegations dated back to 2004.
"We say that both of the men in the dock had sexual contact with her when she was just 12 and they knew how old she was," he said.
"They each, on separate occasions, took her out of the children's home where she was living without permission and with a sinister, ultimately sexually motivated, purpose."
The court heard her mother was a "hopeless addict who was utterly unable or unwilling to care for her" and she had to "fend for herself".
Mr Wright continued: "Living by her wits and befriending men in the hope that they might feed her, or care for her, but as you will hear that was the last thing they did."
Two women - Shahnaz Malik, 57, of St Anne's Avenue, and Naveeda Habeeb, 40, of Prince Wood Lane, are also on trial, charged with child cruelty.
The trial is expected to last two weeks.