“Straight Outta Compton” may take place more than two decades ago, but its themes of racial tension, poverty and police brutality still speak to moviegoers living in a post-Ferguson world.

The biopic about rap group N.W.A debuted to a blistering $56.1 million this weekend in 2,757 theaters, surpassing “American Pie 2” to become the biggest-ever August debut for an R-rated movie. It’s the kind of opening usually reserved for so-called tentpole movies that trade in costumed heroes and special effects, not urban violence.

“The movie tapped into something in our culture and that made it more of a must-see,” said Phil Contrino, vice president and chief analyst at BoxOffice.com.

Its debut nearly doubles “Straight Outta Compton’s” budget of $29 million in a single weekend, meaning the film could be among the most profitable releases of the summer. N.W.A members Ice Cube and Dr. Dre helped produce the film about the early days of gansta rap and were integral to its marketing campaign.

Universal, the studio behind the music biopic, has been having a year for the ages, as a steady stream of hits such as “Jurassic World,” “Fifty Shades of Grey,” “Pitch Perfect 2,” “Furious 7” and “Minions” have pushed its grosses to record heights. Legendary Pictures co-financed “Straight Outta Compton.”

“Straight Outta Compton’s” success overshadowed the weekend’s other new release, Warner Bros.’ “The Man From U.N.C.L.E.” The stylish action-adventure wilted at the megaplexes, bringing in an etiolated $13.5 million from 3,638 theaters. That’s a particularly rough start considering that “The Man From U.N.C.L.E.” cost a sizable $75 million to produce.

The revival of the 1960s television show had been stuck in development hell for nearly as long as N.W.A’s members have been making records, attracting the interest of stars like Tom Cruise and George Clooney and directors like Steven Soderbergh and Quentin Tarantino at various points. The modish version that ultimately made it to screens was directed by Guy Ritchie and stars Henry Cavill and Armie Hammer.

Time may have hurt “The Man From U.N.C.L.E.’s” appeal. The picture struggled to attract younger crowds unfamiliar with the original show and indifferent to the Cold War flareups it dramatizes, as 86% of the opening weekend audience was over the age of 25.

“Guy Ritchie made a terrific picture, but unfortunately it didn’t catch the audience this weekend,” said Jeff Goldstein, Warner Bros. distribution executive vice president. “We know the older audience doesn’t come out on the first day, so hopefully they will find the movie over the next couple of weeks.”

Universal domestic distribution chief Nick Carpou labeled “Straight Outta Compton” as a “labor of love” that benefited from being dramatically different from the kind of films flooding cinemas in recent months.

“The public was ready for something with a bit more substance that they could identify with,” he said.

The film’s opening weekend crowd was 52% female, 51% under the age of 30, 46% African-American, 23% Caucasian, 21% Hispanic and 4% Asian. It did not play in Imax or 3D, but did score in premium large format locations, where it grossed $5.1 million, representing 9% of the film’s weekend receipts.

In second place, Paramount’s “Mission: Impossible – Rogue Nation” continued to get a lift from strong word-of-mouth, picking up $17 million in its third weekend. That brings the fifth film in the spy franchise’s North American haul to $138.1 million.

Fox’s “Fantastic Four” dropped steeply in its second weekend, falling nearly 70% from its debut and mustering a paltry $8 million. The film ranks as one of the biggest comicbook movie flops in history, having earned a meagre $42 million Stateside.

STX Entertainment’s “The Gift” rounded out the top five, earning $6.5 million this weekend and pushing its domestic total to $23.6 million.

In limited release, Sundance favorite “Mistress America” debuted to $94,000 in four theaters, representing a modest per-screen average of $23,500. The comedy about a college freshman (Lola Kirke) who falls under the influence of a wacky Gothamite (Greta Gerwig) was directed by Noah Baumbach and was snapped up by Fox Searchlight before it even screened at the indie festival last winter.

Final numbers are still being tallied, but it looks as though “Straight Outta Compton” will bolster ticket sales over the year-ago period when “Teenage Mutant Ninja Turtles” and “Guardians of the Galaxy” were drawing the biggest crowds.