A disturbed man screaming about the devil sprang out of a walk-in freezer at an Upper West Side restaurant Sunday, wildly swung a knife around and later died after a struggle with kitchen workers, police said Sunday.

“Away from me, Satan!” the man yelled as he ran out of the freezer and into the kitchen of Sarabeth’s on Amsterdam Avenue near West 80th Street, after an employee opened the door at around 11 a.m., cops said.

The raving man then grabbed a kitchen knife and began threatening staff members.

The workers banded together to disarm the man without getting hurt, but during the struggle, he fell unconscious, authorities said.

First responders rushed the 54-year-old man — who police said lived in Arizona, but didn’t immediately identify — to Mount Sinai St. Luke’s Hospital, where he died.

Officials characterized his death as part of a medical episode, but a police source said that the man may have cut himself on the knife he’d been wielding during the melee.

Investigators are working to sort out an exact cause of death, as well as how, when and why the man made his way into the restaurant — questions also on the mind of brunchgoers who showed up at Sarabeth’s on Sunday and stumbled onto the bizarre scene.

“We just came from church,” said Nana Kyerematen, 29, who walked up to the restaurant with two friends to spot a mess of crime-scene tape and police cars.

“At Sarabeth’s, in a place like this, it’s not what you would expect,” she said.

Neighborhood local Joey Epstein, who estimates he’s dined at Sarabeth’s hundreds of times, was similarly floored.

“It’s shocking, especially on the Upper West Side. You don’t expect that to happen around here,” said Epstein, 22. “I really wasn’t expecting a man to be [in the] freezer and then end up dead.”

Officials characterized the man’s chilly hiding spot as a “freezer,” but the manager of a nearby eatery said that it was likely a walk-in refrigerator, explaining that true walk-in freezers are unbearably cold.

“I’m surprised he made it past the workers. What are you doing in there?” wondered Loris Sanchez, manager of the Mediterranean restaurant Vai. “It’s just crazy . . . Only in New York.”

“Maybe the guy was trying to cool down,” Sanchez, 35, quipped in a bit of dark humor, noting that walk-in refrigerators are typically kept at about 42 degrees.

“In this heat, I don’t blame him.”

Additional reporting by Larry Celona