Dick Van Dyke said this week his "beautiful" 51-year-old wife helps keep him feeling youthful at 97 years old. 

The comedy legend admitted "genes" are probably at play in his longevity, but he joked, "Having a beautiful young wife half my age to take care of me — that works."

The "Mary Poppins" star married makeup artist Arlene Silver in 2012. The couple first met in 2006 and were friends for years. 

"My positive attitude, I get that from my wife," Van Dyke told Yahoo! Entertainment in a recent phone interview. 

DICK VAN DYKE AND SARA EVANS UNMASKED ON ‘THE MASKED SINGER’ LEAVING ONE JUDGE IN TEARS 

Dick Van Dyke with his wife Arlene Silver

Dick Van Dyke, 97, and Arlene Silver, 51, have been married 11 years.  (Paul Morigi/Getty Images)

The "Dick Van Dyke Show" actor said he also goes to the gym three days a week.

"I advise everybody to do that, because that's what ages people — it's just a stiffening up and not exercising their muscles and their lungs," he said. "Exercise is the answer."

CLICK HERE TO SIGN UP FOR THE ENTERTAINMENT NEWSLETTER

Van Dyke proved his youthfulness last week, shocking judges of "The Masked Singer" when he revealed himself after singing "When You’re Smiling" in a cumbersome gnome costume. The 97-year-old beat out William Shatner, 91, as the oldest contestant on the show. 

He admitted he "almost fell down" while he was singing inside the costume on the show. 

"It’s dark in there," Van Dyke said. 

Dick Van Dyke posing on the red carpet

Dick Van Dyke says his wife, his genes and staying fit have all played a role in his longevity.  (Andrew Caballero-Reynolds/AFP via Getty Images)

"But nobody guessed me! Which is funny," Van Dyke added.

On the show, celebrities dress in body and face-covering costumes, sing a song and judges Robin Thicke, Jenny McCarthy, Ken Jeong and Nicole Scherzinger try to guess their identity. Van Dyke said the judges guessed he was Dustin Hoffman, Mel Brooks or Robert De Niro. 

"Wait just a minute. Those guys can't sing," he laughed. 

The star also gushed about his wife last year in an interview with Closer magazine. 

"We share an attitude," he told the magazine. "She can go with the flow. She loves to sing and dance, which we do almost every day. She’s just delightful."

Dick Van Dyke and Julie Andrews in a scene from "Mary Poppins"

The "Mary Poppins" star has been acting for decades.  (Donaldson Collection/Getty Images)

He said he worried people would call her a "gold digger" marrying an "old man," but "no one ever took that attitude."

CLICK HERE TO GET THE FOX NEWS APP

For her part, Silver called Van Dyke "the most perfect human being. I’ve never met anyone so happy, so genuine, so amazing. He’s just like a happy pill."

Before he met Silver, Van Dyke was in a relationship with Michelle Triola for more than 30 years. She died of cancer in 2009.