Gardner, a prominent character portrayed by Josh Charles since the series' debut five seasons ago, was gunned down in a Chicago courtroom by his unhinged client. He was pronounced dead shortly afterward.

Gardner was a rival lawyer and former lover of the character played by series star Julianna Margulies.

His death and Charles' decision to exit the show had been well-guarded secrets.

Sending out all my love to #TheGoodWife fans! Playing Will Gardner was an honor and a pleasure. Thanks for all of your support & kind words!

The bombshell ending had reportedly been in the works for more than a year.

"There have been a lot of people that have asked me … why I wanted to leave the show. It really was just something last year I thought about and I thought, however much I enjoyed the experience that I was just ready for the next chapter of my life," Charles said.

"I cried. I have known Josh for a long time so when I heard he would be leaving -- that was last year -- I called the producers and said how about we try and keep him at least half of next year and write his character out with a bang so to speak," Margulies said.

Once the episode had aired, Twitter lit up with astonished and mournful posts.

One viewer called for a group hug, while another issued a plea for a counselor to treat jolted fans. Other viewers vowed never to watch the show again.

Israeli Prime Minister Benjamin Netanyahu warned Tuesday that a proposed agreement between world powers and Iran was "a bad deal" that would not stop Tehran from getting nuclear weapons -- but would rather pave its way to getting lots of them and lea...