A mystery illness has brought TV legend Dick Van Dyke to his knees – and he’s bravely facing his final days.

The 87-year-old star claims he’s suffering from an undiagnosed neurolog­ical disorder that’s robbed him of sleep and left him fatigued.

Now medical sources tell The ENQUIRER that he could be afflicted with a potentially fatal disease!

“My head bangs every time I lay down,” the talented “Mary Poppins” star said in a message on Twitter.

Van Dyke added that he’s been plagued by the headaches for the past seven years and undergone numerous tests, but doctors still haven’t come up with a diagnosis.

“IT’S VERY TROUBLING TO DICK THAT DOCTORS can’t find a reason for the pounding in his head,” said a source close to the “Dick Van Dyke Show” star.

“It’s been going on for some time and he’s con­cerned that this could kill him. He’s worried sick!

“Dick’s friends fear he has a brain disorder. They are concerned doctors can’t discover what’s wrong and are terrified it’s going to kill him before they find out.”

Despite being exhausted, Van Dyke – whose wife, makeup artist Arlene Silver, is 46 years his junior – still puts on a brave face, said the source.

“Dick shows up each week at a health food store in Malibu and buys a health shake,” said the source. “He always waves and smiles even though he doesn’t feel like it. Dick isn’t about to show his public how he really feels. But he’s wondering how much longer this can go on. ”

News of Van Dyke’s debilitating ill­ness surfaced when officials at the 92nd Street Y in New York City sent out a highly unusual me­dia release to announce his April 26 speaking engage­ment was canceled.

“Due to a medical condi­tion, Mr. Van Dyke is un­able to travel to New York for the program,” accord­ing to the statement.

The ENQUIRER has also learned that Van Dyke called off a New York Friars Club salute in his honor scheduled for April 29.

Meanwhile, Van Dyke’s representative confirmed he was ordered to rest at his Malibu home until doctors could determine a “yet-to-be diagnosed neurological disorder.”

Van Dyke’s symptoms can signal numerous disorders, including three potentially serious disor­ders, according to Dr. Joseph Maroon, a specialist in diseases of the brain and team neurosurgeon for the NFL’s Pittsburgh Steelers. “He may be suffering from a brain tumor, an aneurysm or an infectious disease such as meningitis,” Dr. Maroon told The ENQUIRER.

A hormone disorder is another possibility, said Dr. Jerome Spunberg, a radiation oncolo­gist in West Palm Beach, Fla. “To determine what’s causing his headaches and fatigue, doc­tors can order tests including MRIs, brain scans, EEGs and a host of other diagnostic tools,” Dr. Spunberg told The ENQUIRER.

But Van Dyke – who also starred in the long-running CBS series “Diagnosis Murder” – said in a mes­sage on Twitter: “I’ve had every test come back that I’m perfectly healthy.”