Stanford University neurosurgeon Dr. James Doty tells the story of performing surgery on a little boy’s brain tumor. In the middle of the procedure, the resident who is assisting him gets distracted and accidentally pierces a vein. With blood shedding everywhere, Doty is no longer able to see the delicate brain area he is working on. The boy’s life is at stake. Doty is left with no other choice than to blindly reaching into the affected area in the hopes of locating and clamping the vein. Fortunately, he is successful.

Most of us are not brain surgeons, but we certainly are all confronted with situations in which an employee makes a grave mistake, potentially ruining a critical project.

The question is: How should we react when an employee (or partner or child) is not performing well or makes a mistake?

Frustration is of course the natural response — and one we all can identify with. Especially if the mistake hurts an important project or reflects badly upon us.

The traditional approach is to reprimand the employee in some way. The hope is that some form of punishment will be beneficial: it will teach the employee a lesson. Expressing our frustration also may relieve us of the stress and anger caused by the mistake. Finally, it may help the rest of the team stay on their toes to avoid making future errors.

Some managers, however, choose a different response when confronted by an underperforming employee: compassion and curiosity. Not that a part of them isn’t frustrated or exasperated — maybe they still worry about how their employee’s mistakes will reflect back on them — but they are somehow able to suspend judgment and may even be able to use the moment to do a bit of coaching.

What does research say is best? The more compassionate response will get you more powerful results.

First, compassion and curiosity increase employee loyalty and trust. Research has shown that feelings of warmth and positive relationships at work have a greater say over employee loyalty than the size of their paycheck.  In particular, a study by Jonathan Haidt of New York University shows that the more employees look up to their leaders and are moved by their compassion or kindness (a state he terms elevation), the more loyal they become to him or her. So if you are more compassionate to your employee, not only will he or she be more loyal to you, but anyone else who has witnessed your behavior may also experience elevation and feel more devoted to you.

Conversely, responding with anger or frustration erodes loyalty. As Adam Grant, Professor at the Wharton Business School and best-selling author of Give & Take, points out that, because of the law of reciprocity, if you embarrass or blame an employee too harshly, your reaction may end up coming around to haunt you. “Next time you need to rely on that employee, you may have lost some of the loyalty that was there before,” he told me.

We are especially sensitive to signs of trustworthiness in our leaders, and compassion increases our willingness to trust. Simply put, our brains respond more positively to bosses who have shown us empathy, as neuroimaging research confirms. Employee trust in turn improves performance.

Doty, who is also Director of Stanford University’s Center for Compassion and Altruism Research and Education, recalls his first experience in the OR room. He was so nervous that he perspired profusely. Soon enough, a drop of sweat fell into the operation site and contaminated it. The operation was a simple one and the patients’ life was in no way at stake. As for the operation site, it could have been easily irrigated. However, the operating surgeon — one of the biggest names in surgery at the time — was so angry that he kicked Doty out of the OR room. Doty recalls returning home and crying tears of devastation.

Tellingly, Doty explains in an interview how, if the surgeon had acted differently, he would have gained Doty’s undying loyalty. “If the surgeon, instead of raging, had said something like: Listen young man watch what just happened, you contaminated the field. I know you’re nervous. You can’t be nervous if you want to be a surgeon. Why don’t you go outside and take a few minutes to collect yourself. Readjust your cap in such a way that the sweat doesn’t pour down your face. Then come back and I’ll show you something. Well, then he would have been my hero forever.”

Not only does an angry response erode loyalty and trust, it also inhibits creativity by jacking up the employee’s stress levels. As Doty explains, “Creating an environment where there is fearanxiety and lack of trust makes people shut down. If people have fear and anxiety, we know from neuroscience that their threat response is engaged, their cognitive control is impacted. As a consequence, their productivity and creativity diminish.” For instance, brain imaging studies show that, when we feel safe, our brain’s stress response is lower.

Grant also agrees that “when you respond in a frustrated, furious manner, the employee becomes less likely to take risks in the future because s/he worries about the negative consequences of making mistakes. In other words, you kill the culture of experimentation that is critical to learning and innovation.” Grant refers to research by Fiona Lee at the University of Michigan that shows that promoting a culture of safety — rather than fear of negative consequences – helps encourage the spirit of experimentation so critical for creativity.

There is, of course, a reason we feel anger. Research shows that feelings of anger can have beneficial results – for example, they can give us the energy to stand up against injustice. Moreover, they make us appear more powerful. However, when as a leader you express negative emotions like anger, your employees actually view you as less effective. Conversely, being likable and projecting warmth — not toughness — gives leaders a distinct advantage, as Amy Cuddy of Harvard Business School has shown.

So how can you respond with more compassion the next time an employee makes a serious mistake?

1. Take a moment. Doty explains that the first thing is to get a handle on your own emotions — anger, frustration, or whatever the case may be. “You have to take a step back and control your own emotional response because if you act out of emotional engagement, you are not thoughtful about your approach to the problem. By stepping back and taking a period of time to reflect, you enter a mental state that allows for a more thoughtful, reasonable and discerned response.” Practicing meditation can help improve your self-awareness and emotional control.

You don’t want to operate from a place where you are just pretending not to be angry. Research shows that this kind of pretense actually ends up raising both your and your employee’s heart rates. Instead, take some time to cool off so you can see the situation with more detachment.

2. Put yourself in your employees’ shoes.  Taking a step back will help give you the ability to empathize with your employee. Why was Dr. Doty, in the near-tragic OR moment, able to respond compassionately to his resident? As a consequence of recalling his own first experience in the OR room, he could identify and empathize with the resident. This allowed him to curb his frustration, avoid degrading the already horrified resident, and maintain the presence of mind to save a little boy’s life.

The ability to perspective-take is a valuable one. Studies have shown that it helps you see aspects of the situation you may not have noticed and leads to better results in interactions and negotiations. And because positions of power tend to lower our natural inclination for empathy, it is particularly important that managers have the self-awareness to make sure they practice seeing situations form their employee’s perspective.

3. Forgive. Empathy, of course, helps you forgive.

Forgiveness not only strengthens your relationship with your employee by promoting loyalty, it turns out that it is also good for you. Whereas carrying a grudge is bad for your heart (blood pressure and heart rate both go up), forgiveness lowers both your blood pressure and that of the person you’re forgiving. Other studies show that forgiveness makes you happier and more satisfied with life, significantly reducing stress and negative emotions.

When trust, loyalty, and creativity are high, and stress is low, employees are happier and more productive and turnover is lower. Positive interactions even make employeeshealthier and require fewer sick days. Other studies have shown how compassionate management leads to improvements in customer service and client outcomes and satisfaction.

Doty told me he’s never thrown anyone out of his OR. “It’s not that I let them off the hook, but by choosing a compassionate response when they know they have made a mistake, they are not destroyed, they have learned a lesson, and they want to improve for you because you’ve been kind to them.”

Interested in more news like this? Follow Emma Seppala on Twitter @emmaseppala and visit emmaseppala.com

A version of this article first appeared in Harvard Business Review.