Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

"Green Book" director Peter Farrelly called himself an "idiot" and apologized for exposing himself on the set of "There's Something About Mary," more than 20 years ago.

The Cut found a 1998 Newsweek article recounting how Farrelly — with help of his directing partner and brother Bobby — would trick cast members into looking at his genitals.

"True. I was an idiot," Peter Farrelly said in a statement to The Cut, an online wing of New York magazine. "I did this decades ago and I thought I was being funny and the truth is I'm embarrassed and it makes me cringe now. I’m deeply sorry." Farrelly's representative released the same statement later to NBC News.

That Newsweek piece said "Mary" actress Cameron Diaz and Tom Rothman, then a senior executive of the movie's distributor Twentieth Century Fox, were among those who were flashed.

In addition to "Mary," the Farrelly brothers have teamed up for other comedies such as "Dumb and Dumber," Shallow Hal," "Kingpin" and "Me Myself & Irene."

Peter Farrelly's apology came hours after social media miners on Wednesday unearthed a since-deleted tweet by "Green Book" screenwriter Nick Vallelonga, apparently supporting then-candidate Donald Trump's unsubstantiated claim that New Jersey Muslims cheered the Sept. 11, 2001, terror attacks.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

Vallelonga deactivated his account.

"100% correct," Vallelonga tweeted at Trump in 2015. "Muslims in Jersey City cheering when towers went down. I saw it when you did, possibly on local CBS News."

Candidate Trump claimed he saw, on television, Muslims in Jersey City cheering on 9/11.

As NBC News reported in 2016, extensive reviews of television coverage found no footage of Muslims cheering in Jersey City in the wake of the attacks.

However, CBS New York affiliate WCBS did report on Sept. 16, 2001 that an unidentified investigator claimed eight men in Jersey City were "cheering on the roof when they saw the plane slam into the Trade Center," according to Politifact. That WCBS story, though, showed no footage.

"Green Book" won a Golden Globe Award on Sunday for best musical or comedy movie.

The movie featured Mahershala Ali and Viggo Mortenson as a black concert pianist and his Italian-American driver who become unlikely friends as they drove through the Jim Crow south in 1962.

Vallelonga apologized in a statement Thursday.

"I want to apologize. I spent my life trying to bring this story of overcoming differences and finding common ground to the screen, and I am incredibly sorry to everyone associated with 'Green Book,'" Vallelonga said

"I especially deeply apologize to the brilliant and kind Mahershala Ali, and all member of the Muslim faith, for the hurt I have caused," he said. "I am also sorry to my late father who changed so much from Dr. Shirley’s friendship and I promise this lesson is not lost on me. 'Green Book' is a story about love, acceptance and overcoming barriers, and I will do better."