It’s a marketing executive’s worst nightmare. A playful tweet is misinterpreted, taking on a new, twisted meaning. Someone accidentally (or intentionally) posts something lewd on the brand’s social media accounts. A hashtag campaign totally backfires.

It happens, even if systems and processes can reduce the risk to almost zero. For brands, the question isn’t if or when it will happen, but how to react.

Below are four principles for senior marketers to follow when social media mistakes take a life of their own. Be ready to follow them and to navigate your team through those moments. (And be sure to include plans for these social blunders as part of your overall reputation crisis playbook).

Hope for the Best (But Prepare for the Worst)

Brand and marketing managers can’t anticipate the scope of the impact that a seemingly negligible mistake can make, or what direction the Internet’s hive mind will take it. Errors in judgment often assume a life of their own, and can quickly spiral out of control.

A brand’s best intention can take a disastrous turn. The New York City Police Department learned that the hard way in 2014 when it invited users to use the #myNYPD to tell stories of their experiences with the force.

The backfire was tremendous. Hundreds of people chimed in with photos suggesting police misbehavior.

“It is very important to take a look at the community you’re going to be addressing and assess the potential pitfalls for something like this,” Anthony Rotolo, a digital media professor at Syracuse University said in an interview with the Wall Street Journal. Building a positive rapport with the audience “well in advance” of calling on them to weigh in could have helped, he said.

After a misstep goes viral, even the most well crafted response doesn’t wipe the slate clean. Brands should be prepared to deal with possible fallout for the indefinite future and be aware of past slipups.

History has a way of creeping back into the social consciousness. When Tesco, a UK-based supermarket chain used the popular idiom “hit the hay” in a tweet to say goodnight, it unwittingly resurfaced a past scandal involving the sale of horsemeat as beef. The brand’s audience hadn’t forgotten.

React Quickly

Time is of the essence as brands mull over how to react to a social media mistake. As they decide whether to strike a humorous or more serious tone, content marketers should remember that a quick response is better than a clever one.

Control is lost for every minute a mistake sits online without some kind of corrective action being taken on it. The spread of misinformation can be very hard to contain, especially if the error is more provocative than the intended message.

Using strong monitoring tools helps optimize recovery time, so long as you have a team in place to jump on any red flags. Remember Justine Sacco’s cautionary tale.

The former PR executive sent this distasteful tweet to her 170 followers before boarding a flight to South Africa in 2013. She then boarded the 11-hour flight with no Internet access. While she slept, the Twitterverse exploded. Needless to say, she lost her job—and that was just the beginning of her nightmare.

Had she seen the first few responses to her tweet, she could’ve contained the fallout. Instead, she sparked a global witch-hunt, with tens of thousands of Twitter users awaiting her flight’s landing.

Admit the Mistake

Accepting blame for things that happen on a social media account, whether it was the fault of an inexperienced intern or an outside hacker, is the first step brands take to reestablish credibility with your audience. It demonstrates transparency.

Craig Silverman, a journalist and expert on media corrections and errors, calls it the paradox of trust. “Admitting our mistakes and failings makes us more deserving of trust,” he writes.

One of the most highly cited recent examples was when DiGiorno Pizza carelessly jumped on a hashtag that was trending on Twitter in late 2014.

“#WhyIStayed You had pizza,” Digiorno tweeted, unwittingly committing a huge gaffe. The hashtag was being used by thousands of women sharing why they stayed in abusive relationships.

Digiorno deleted the tweet and issued more than one apology.

When it comes to social media corrections, Twitter is notoriously difficult compared to other platforms. Silverman says the ideal way to issue a Twitter correction is to “send it as a reply to your original, mistaken tweet,” and make it obvious—putting an all caps “CORRECTION” at the beginning of the tweet helps if there’s a factual error. Either way, offer a clear explanation of how you screwed up.

If a tweet has already been retweeted many times, Silverman suggests reaching out to the most influential users that broadcast your message to help stop the spread of misinformation. Deleting is only appropriate if there are legal issues, or if “the erroneous information continues to be retweeted at a significantly faster pace than the correction.”

Admitting a mistake also applies to engagement that originates from customers. A benign complaint on a company’s Facebook page could build traction among users with a shared bad experience, and snowball into a force of bad press.

Be Patient

At some point, it’s time to move on. Don’t rush it. When a brand is embroiled in controversy, it can be hard or even ill advised to try and change the topic of conversation too hastily.

If it’s a silly mistake, it may be appropriate to pivot the conversation and capitalize on the increased attention. Otherwise, damage control should probably be the only thing on the agenda.

A brand’s resilience and ability to bounce back in the face of controversy comes down to agility and transparency. Help your team operate social media accounts with a sense of urgency and duty to your fans. Put in the work to repair your reputation. Above all, be honest, be humble and take responsibility.

Social is still a critical part of Marketing’s operations, and the interactions you have on platforms can have a powerful effect. That means you still have to take part in conversations—but it also means you have to manage the risk of others’ reactions to social media stumbles. Take a proactive approach to maintaining a consistent brand experience on social, and be ready to enact emergency damage control measures.