Four years ago, PR exec Scott Emalfarb received a phone call from his company’s HR department. Thirty minutes later, he was packing his belongings into a box with a HR exec waiting to escort him out, a scene that every colleague on his team saw.

“It was kind of embarrassing and a little juvenile,” says Emalfarb, now 34 and the president of Fresh Content Society, a Chicago social media marketing firm.

Emalfarb’s experience was replicated under an exponentially larger public eye yesterday when FBI director James Comey was sacked by President Donald Trump. Comey was addressing FBI agents in Los Angeles yesterday when news first broke. So unexpected was his firing that until reports aired on television, Comey reportedly thought that it was a joke. TV cameras tracked his every move thereafter, even airing footage of his plane on a tarmac. Trump then went on a Twitter rampage, explaining why he thought a man he had previously praised was let go.

The former FBI head joins a long list of people who’ve been canned in plain sight. Former Vogue editor-in-chief Grace Mirabella famously found out that she’d been let go in 1988 via a TV news report. AOL chief executive Tim Armstrong fired a top employee during a conference call in 2013, when the staffer tried snapping his photo (Armstrong later apologized for being too callous.)

If struck by public misfortune, workplace experts recommend being calm. “Take a deep breath and remind yourself that you’ll be ok,” says Eden Abrahams, managing partner at Clear Path Executive Coaching. Take the high road and resist striking back publicly, at least immediately. “Put some time in between what was said to you and your overall reaction,” advises Elaine Swann, author of “Let Crazy Be Crazy,” a guide to dealing with rude people.

In some cases—particularly if you’re a senior exec or public figure like Comey—issuing a brief statement might be appropriate. “It’s nice to thank your team members and colleagues for the great experience that you’ve had,” Abrahams says. “That’s especially if you have a lot of longtime friends and colleagues, who will have a lot of concern and worry for you.”

One good public example to model is Sree Sreenivasan, who was let go as chief digital officer at the Metropolitan Museum of Art. He posted a gracious note on social media about his three years at the Met, admitted he had no immediate career plans and invited friends to hang out with him. “He turned it into a very transparent process and wound up owning the narrative,” Abrahams says.

Experts are also adamant that managers shouldn’t emulate President Trump’s firing of Comey when they have to let an employee go.  “It’s wrong to make a public statement,” says Swann. “You should always tell the employee first.”

The immediate bipartisan backlash against Trump is a big reason why. “The court of social media is quick to condemn if they think the firing is a public hatchet job,” notes Abrahams. “It’s a boomerang and makes the company look bad.”