Straight Outta Compton ruled the box office this weekend. The N.W.A biopic debuted at No. 1 with a whopping $56.1 million.

The F. Gary Gray-directed film, which chronicles the rise of the world’s most dangerous group, set a record for the biggest August opening ever for an R-rated film, surpassing the $45.1 million opening for American Pie 2 in 2001.

It also earned the best opening ever for a music biopic, outperforming the Johnny Cash drama Walk the Line ($22.3 million) in 2005 and Eminem’s 8 Mile ($51.2 million) in 2002.

Compton nearly doubled its $29 million budget in a single weekend, and could become one of the most profitable releases of the summer. Ice Cube and Dr. Dre helped produce the film, along with Eazy-E’s widow Tomica Woods-Wright.

Not only did it beat projections, it also crushed the competition including runner-up Mission: Impossible – Rogue Nation, which made $17 million in its third weekend, while The Man From U.N.C.L.E. debuted with $13.5 million.

The companion album, Compton: A Soundtrack by Dr. Dre, is also headed for a big opening. Dre’s first album in 16 years could sell as many as 300,000 copies in its first week.