West Coast gangsta rap legend Ice Cube will be appearing in 'Rampart,' a new film about the scandal-ridden 1990s Los Angeles Police Department.

'Rampart' is based on a screenplay by revered Los Angeles crime novelist James Ellroy, and is set in the mid-90's, when the LAPD was rumored to have had ties to the murders of Biggie and Tupac.

Cube will be playing an LAPD officer involved with the city's anti-gang program, Community Resources Against Street Hoodlums (CRASH), who were accused of committing shootings, beatings, armed robbery, drug peddling, evidence planting and perjury. The film will also star Woody Harrelson and Ben Foster, and will be helmed by Oren Moverman, director of the Academy Award-nominated war film 'The Messenger.'This is not the first time Ice Cube has appeared in a corrupt cop film; in 1995 he played a similar part in 'The Glass Shield,' which also starred Lori Petty.

'Rampart' is scheduled to shoot in Los Angeles in late August. Cube's documentary about the L.A. Raiders, 'Straight Outta L.A.,' recently premiered at the Tribeca Film Festival.