Pierce Brosnan has revealed the comment that may have cost him a major movie role.

The actor appeared on "The Tonight Show" on Tuesday, and shared that he auditioned for Tim Burton's 1989 hit film "Batman."

"I went up for Batman way back in the day when Tim Burton was doing it. Obviously, I didn’t get the job," the Irish actor told the show's host, Jimmy Fallon.

"I remember saying something stupid to Tim Burton. I said, ‘You know I can’t understand any man who would wear his underpants outside his trousers.’ But there you go… the best man got the job."

Pierce Brosnan Keely Shaye Smith

Pierce Brosnan and Keely Shaye Smith were all smiles at the "Black Adam" movie premiere. (Getty Images)

PIERCE BROSNAN SAYS HE'LL NEVER PLAY JAMES BOND AGAIN: 'THAT'S ANOTHER MAN'S JOB'

In the end, the iconic role went to actor Michael Keaton, who reprised the role in "Batman Returns" in 1992.

Brosnan ended up taking on another iconic role: James Bond. He played 007 in four Bond films, from 1995 to 2002.

Pierce Brosnan and wife out to dinner

Pierce Brosnan and Keely Shaye Smith enjoyed a date night at the Polo Bar in Manhattan. (Mega)

CLICK HERE TO SIGN UP FOR THE ENTERTAINMENT NEWSLETTER

Now Brosnan is starring as Dr. Fate in the superhero film "Black Adam." He hit the red carpet for the New York premiere Wednesday night, accompanied by his wife, Keely Shaye Smith.

The previous night, the couple stepped out at the Polo Bar in New York City, looking very much in love and all smiles for dinner.

Pierce Brosnan and wife Keely Shaye Smith hit the town in New York City.

Pierce Brosnan and wife Keely Shaye Smith hit the town in New York City. (Mega)

But there has been some off-screen drama for the actor recently. Last week, Brosnan filed a request for a restraining order against a woman who he claimed was stalking him and his family.

The James Bond actor issued the complaint in Los Angeles, according to the Los Angeles Times. He alleged that the 55-year-old woman, identified as Michelle Welch Mulready, had been "parked in front of my house, stalking me, my family and guests."

CLICK HERE TO GET THE FOX NEWS APP

While Brosnan said Mulready did not threaten him or inflict harm, the order also protects his wife and their two sons.