Grey's Anatomy creator Shonda Rhimes has explained why she shocked fans by killing off Patrick Dempsey's character, Derek 'McDreamy' Sheppard, claiming that he had to die to keep the integrity of his relationship with Meredith (Ellen Pompeo) intact.

The character died following a car crash in season 11, with wife Meredith consenting to have him taken off life support.

In a panel discussion at the Television Critics Association's summer press tour in the US, Rhimes said of the storyline: "The decision to have the character die the way that he did was not a difficult one, in the sense of 'What were the options'?

"Either Derek was going to walk out on Meredith and leave her high and dry and what was that going to mean?" 

She continued: "That was going to suggest that their love was not true - that the thing we said for 11 years was a lie and McDreamy wasn't McDreamy and that was untenable. Meredith and Derek's love had to remain Meredith and Derek's love." 

Rhimes said killing the character off was "painful" for her as a storyteller, but she could not have depicted him as a "bad guy" who left his wife and child. 

"For me, the only way was to make Derek and Meredith's magic to remain true and forever frozen in time," she added.