Patrick Dempsey returned to "Grey's Anatomy" to fans' surprise and elation.

The actor appeared on the ABC medical drama as neurosurgeon Derek "McDreamy" Shepherd from Seasons 1 through 11 before his character ultimately died.

There have long been rumors Shepherd would return but it wasn't until the Season 17 premiere when it finally happened. 

"The response has been incredibly overwhelming and very moving," Dempsey told Ellen DeGeneres on "The Ellen DeGeneres Show" this week. 

'GREY'S ANATOMY' FANS STUNNED BY PATRICK DEMPSEY'S RETURN IN SEASON 17 PREMIERE: 'I CRIED SO MUCH'

The 54-year-old admitted it was Ellen Pompeo's idea. She thought the show's audience would appreciate the cameo amid the coronavirus pandemic. 

"What a great opportunity for people and how great it would be for the fans, really, to see everybody reunited in this sort of bizarre way," he said.

Dempsey admitted filming was a hard secret to keep and required lots of planning. In the show, Pompeo's character Meredith Grey collapses and wakes up in a dream with Dempsey's character on a beach.

"Nobody knew about it other than ABC of course, some people at ABC, [showrunner] Krista [Vernoff] and then Ellen [Pompeo] and myself. And that was it," he revealed. "And then we started talking to the directors, which would be Debbie Allen — who's amazing — and Kevin McKidd, who's one of the directors that I worked with. And that was it."

'GREY'S ANATOMY' CAST THANKS MEDICAL WORKERS FIGHTING CORONAVIRUS: 'WE ARE SO GRATEFUL'

"No one knew until I showed up on set that day," Dempsey added. "And then we were really concerned that someone would take a picture and it would be out somehow, but we managed to keep it a secret, which was pretty phenomenal."

The "Sweet Home Alabama" star previously told Deadline that he loved getting back into character.

Patrick Dempsey returned at Dr. Derek Shepherd on 'Grey's Anatomy.'

Patrick Dempsey returned at Dr. Derek Shepherd on 'Grey's Anatomy.' (ABC)

"It was really exciting and fun, and it was great to see everybody. ...," he said. "The dynamic behind the camera had changed. There’s much more diversity within the crew. There was a nice balance, too, of equality that I was seeing. So, culturally, there were a lot of things that were different, that I thought were very positive and very inspiring, actually."

Pompeo and Dempsey were both tested for COVID before shooting. 

"Patrick and I have this chemistry where I think even from when we first met, for some reason it just felt like we’ve known each other for a hundred years, and it’s just the same feeling," she told the outlet. "It’s like riding a bike, we just have a chemistry and a dynamic that’s always served us well, and I think we have a genuine affection for each other."

Meanwhile, fans can rest assured that wasn't the last time they'll see Dempsey on screen. Vernoff told the Los Angeles Times last week that he's going to be back for more. 

CLICK HERE TO GET THE FOX NEWS APP

"We will see more of [Derek] this season," she teased. "This was not just a cameo. He will appear three more times."

Season 17 of 'Grey's Anatomy' airs Thursdays on ABC at 9 p.m. ET.