The R-rated comedy, left for dead by some Hollywood studios, again reached No.1 at the North American box office over the weekend thanks to the raunchy coming-of-age tale “Good Boys” about a trio of 12-year-olds on a crude misadventure.

“Good Boys” surpassed expectations to debut with $21 million, according to studio estimates Sunday, dethroning the “Fast & Furious” spinoff “Hobbs & Shaw,” which slid to second with $14.1 million in its third weekend. Not since Melissa McCarthy’s “The Boss” came in No. 1 back in April 2016 has an R-rated comedy topped the North American box office.

“This is like a unicorn sighting,” said Paul Dergarabedian, senior media analyst for data firm Comscore.

In recent years, R-rated horror has largely taken the place of R-rated comedy at the box office, as Hollywood has increasingly ceded the genre to TV and streaming services. But Universal Pictures, which released “Good Boys,” has kept the flame. The studio was behind “The Boss” as well as the intervening years’ highest grossing domestic comedies: 2017’s “Girls Trip” and 2018’s “Night School.”

“Good Boys” broke out of a crowded late-summer field of new releases. The weekend’s other new widely released films - the animated sequel “The Angry Birds Movie 2,” the shark attack sequel “47 Meters Down: Uncaged,” the Bruce Springsteen-inspired drama “Blinded by the Light” and Richard Linklater’s Cate Blanchett-led “Where’d You Go Bernadette” - all fizzled.

Directed by Gene Stupnitsky (who co-wrote the script with Lee Eisenberg), “Good Boys” stars Jacob Tremblay, Keith L. Williams and Brady Noon as sixth graders trying to make it to their first kissing party. The movie’s much-watched red-band trailer traded on its ironies. As producer Seth Rogen says, Tremblay, Williams and Noon are all too young to see their own movie alone.

Jim Orr, distribution chief for Universal, credited Rogen and Goldberg’s Point Grey Pictures company and the film’s marketing for the film’s performance.

“This is a genre that is very difficult to do, and we’re having great success as a studio with a very diverse slate,” Orr said. “One of the common denominators there is, [is] our marketing department. They just over-deliver constantly with a broad range of films.”

The challenge of “Good Boys” was to turn out moviegoers older than the movie’s pipsqueak protagonists, and it did. Only 7 percent of the audience was under age 18, according to Universal, though 41 percent was under 25. Crowds split evenly between the sexes: 52 percent male, 48 percent female.

The release strategies behind some of the weekend’s other new films were harder to discern.

Sony’s “The Angry Birds Movie 2,” on a budget of $65 million, opened with a paltry $10.5 million domestically, though it added $19.4 million internationally. Hoping to snarl kids before school starts, Sony released the film on Tuesday. But it didn’t come close to the $38.2 million domestic debut of the first installment in 2016 despite notably better reviews.

Sony’s “Once Upon a Time ... in Hollywood,” however, grossed $53.7 million overseas after expanding to 46 markets, the largest foreign launch for any Quentin Tarantino film and the best worldwide haul for any film this weekend.

“47 Meters Down: Uncaged,” from Entertainment Studios, also showed little bite. It debuted with $9 million, a slight downtick from the $11.2 million the first movie opened with in 2017.