Sarah Hyland gave a half-hearted apology to fans after sharing a major spoiler for her character in “Modern Family.”

The star shared an exclusive sneak peek at Wednesday’s upcoming episode of the hit ABC sitcom on social media, much to the dismay of many fans that were eager to see how the events unfolded on screen rather than have it ruined for them just by scrolling through their Twitter feed.

GORDON RAMSAY SLAMMED FOR UNCOMFORTABLE SOFIA VERGARA 'TONIGHT SHOW' INTERVIEW IN 2010

[SPOILER ALERT: The remainder of this article will discuss spoilers for the latest episode of “Modern Family.”]

It was revealed during a previous episode that her character, Haley Dunphy, is pregnant. Having already broken the news to the family as well as the father, her on-again, off-again boyfriend Dylan, the time has come to get the doctors involved.

In Wednesday’s episode, People revealed that Haley will go in for her first ultrasound where she’ll hear two heartbeats. That’s right, “Modern Family” fans, Haley is pregnant with twins. Fortunately, those reading the news here elected to see the spoiler. Those who follow Hyland on Twitter, however, were privy to the information with no real warning after the star tweeted the preview.

One fan called Hyland out on the social media faux pas asking, “Why did you have to share a spoiler though?”

Hyland responded with a somewhat not-so-satisfying explanation and apology.

DID 'MODERN FAMILY' STAR SARAH HYLAND HAVE A NIP SLIP AHEAD OF THE 2019 GOLDEN GLOBES?

“Because I was told to,” she wrote. “Sowwwyyyyy.”

As TheWrap notes, this isn’t the first time that Hyland has dropped some “Modern Family” spoilers on her social media. The 28-year-old star previously ruined the big surprise of which character would meet their demise in the highly teased twist of the new season.

CLICK HERE TO GET THE FOX NEWS APP

In an Instagram post she posted an image of herself and co-star Ariel Winter with Shelley Long, whose DeDe Pritchett character was killed off during the previous night’s episode. Unfortunately, many fans had yet to see the episode and called out the star for spoiling a major plot point for the long-running series.