Peter Capaldi says a fateful trip to his favorite suit shop led to his discovery that a woman would be taking over his role in "Doctor Who."

The Scottish actor announced this year he is leaving the show after three seasons. His final appearance will be in the 2017 "Doctor Who" Christmas special.

The BBC announced in July he would be replaced by Jodie Whittaker, who is the first woman to play the titular time-traveler.

"It was kept very secret. I didn't know anything about it," Capaldi told fans with a laugh at New York Comic Friday.

The actor said he had an inkling about the casting when he went shopping for suits and was told by a store employee: "We just got a call from the 'Doctor Who' office, saying, 'Can we have a pair of your trousers, but with a waist size 30?'"

He continued: "So, they were obviously looking for a pair of trousers for the new Doctor Who to wear and I thought, 'Well, that can't really be a man, with a 30 inch waist.' So, I thought, 'It must be a lady then.'"

"And then they just called me a couple of days later before it was announced. Then I called Jodie and it was lovely to talk to her. She just lives up the road from me."

Capaldi said even though they are neighbors he hadn't met her in person until recently.

Reality TV World is now available on the all-new Google News app and website. Click here to visit our Google News page, and then click FOLLOW to add us as a news source!
"She said, 'We've sat in the same cafes and coffee bars for the last three months.' And she said, 'I haven't been able to come and say hello to you because the reason I'd be coming to say hello to you is to say I'm the new Doctor Who,'" Capaldi recalled.

"She's amazing and I saw what she's done and it's great, so it's in really good hands."

After the question-and-answer session at the Theater at Madison Square Garden, a video of fans telling Capaldi how much they love and will miss him was screened.

Visibly moved by the film and the standing ovation it inspired, Capaldi addressed the audience, saying: "Thank you all. You are so nice and so kind and so goodhearted. You are the future and Jodie Whittaker is so lucky and so are you. This enthusiasm, kindness and generosity is the best thing about the human race. That's what you are. Thank you."