"Modern Family" fans were left shocked after the death of a beloved character on the show's last night's episode and so was the original cast member Sarah Hyland, who plays the role of Hailey Dunphy. In its eleventh and the final season, the series killed off another character, Frank Dunphy.

On January 15 episode titled "Legacy," Phil Dunphy gets to spend one of his best days with his father, Frank, played by Fred Willard. The death comes as a surprise to Phil and viewers simply got a glimpse of him delivering an emotional eulogy to his late father.

Later, after the broadcast of the episode, Sarah Hyland took to her Instagram to express her shock over the death of the on-screen grandfather. In an unexpected revelation, she informed that she wasn't aware of the tragic ending to Willard's character.

"So, I don't read scripts of episodes of Modern Family that I'm not in, so I just found out that my grandpa's dead along with all of you," Hyland wrote on her Instagram stories as quoted by Just Jared.

"I guess I should've put a spoiler alert for Grandpa Frank dying, but I was just caught off guard." She added.

She went on to apologise for spoiling the show for those followers who may have not watched the episode. She said that karma is served to her by her pet, who she fondly calls her daughter and named her Boo.

"Like, as his granddaughter, you think I'd be invited to his funeral," Hyland continued. "If it's any consolation to those who are angry about the spoiler alert, karma hit real fast and Boo just farted in my face and the smell was so bad she had to get off the bed because she couldn't handle the heat," she added.

Frank Dunphy's death comes after another significant character in Season 10. Earlier, this season, DeDe Pritchett was killed off, off-screen. DeDe was Jay's ex-wife and Claire and Mitchell's mother.

Sarah Hyland
Sarah Hyland plays Haley Dunphy on the popular sitcom Modern Family Frazer Harrison/Getty

"Modern Family" airs Wednesdays on ABC. The long-running sitcom is slated to come to an end with an episode airing on Wednesday, April 8.