A former basketball player at San Jose State University has sued two former coaches and the university for alleged racial discrimination, religious discrimination and sexual harassment.

Gary Williams, who played for the San Jose State Spartans in the 2015-16 and 2016-17 seasons, filed the lawsuit in federal court in San Jose on Monday.

Williams, who is black, alleges that former head coach David Wojcik discriminated against him on the basis of race by giving him less playing time, ridiculing black players' mental abilities and telling players he would "work them like slaves."

Kavin Mistry/ The Spear

He also claims Wojcik mocked him for praying before games.

The lawsuit additionally claims Wojcik harassed Williams and other players by calling them sexually derogatory terms.

Tyler Ojanen, a former assistant coach who is now the university's director of Olympic sports operations, is accused in the lawsuit of participating in the alleged discrimination.

The lawsuit seeks unspecified financial compensation and a court order requiring the defendants to carry out their legal duties.

Wojcik resigned in July. The university's announcement of his departure included a statement in which he said, "This past year has been emotionally challenging for me with the loss of my father... I believe it is the appropriate time for me to resign."

University spokeswoman Patricia Harris said she could not comment on the lawsuit.