Ex-UCLA basketball star Billy Knight was arrested back in June after officials say he sexually abused a child … and sources say the victim was only 9 years old.

In the weeks before Knight apparently killed himself, the 39-year-old was arrested and charged with 6 felonies for sexual encounters involving a girl under the age of 15.

Officials tell us … Knight was arrested in Phoenix, Arizona on June 14.

Prosecutors in Maricopa County charged Knight with multiple counts of sexual conduct with a minor, sexual abuse and molestation of a child.

In court docs obtained by TMZ Sports, prosecutors say some of the abuse took place at the victim’s home — and on her mother’s bed.

Arizona is particularly tough when it comes to sex crimes involving minors — and it appears he was facing more than 50 YEARS in prison if convicted on all charges.

READ MORE: