New York (CNN Business) "Joker," the gritty comic book film about the origins of the crazed Batman villain, has become the highest-grossing R-rated film of all time.

The film, which stars Joaquin Phoenix as a troubled man who turns into a killer clown, has made roughly $788 million at the worldwide box office, Warner Bros. confirmed on Friday. That is enough to eclipse the record set by "Deadpool," which made $783 million globally when it came out in 2016.

Ryan Reynolds, the star of "Deadpool," offered his congratulations on social media Friday.

"R-Rated box office congratulatory posts aren't like the ones you're used to," Reynolds tweeted with a photo of Phoenix's Joker dancing above names of characters from other successful R-rated films like "It" and "Ted."

R-Rated box office congratulatory posts aren't like the ones you're used to... pic.twitter.com/OTy2BqIP4f — Ryan Reynolds (@VancityReynolds) October 25, 2019

The film may be the highest-grossing R-rated film globally, but it still has a long way to before beating the highest-grossing R-rated film domestically. That record still belongs to Mel Gibson's biblical drama "The Passion of the Christ," which made $370 million in North America in 2004. "Joker" has so far made $259 million in the US.

Read More