We all need friends at work. Looking for advice on a project? Want to celebrate a major client win or milestone? Need to vent about how demanding, controlling, unreasonable, ignorant, awful, and stupid the boss is? That’s what friends are for.

And there are proven benefits to such relationships. Research from Gallup has shown that people who have best friends at work are more engaged, and that their organizations show higher profitability and customer loyalty than those in which close friendships between colleagues are less common. Psychologist Abraham Maslow argued 60 years ago that a sense of belonging is one of the most basic human needs, right after food, water and safety. I think it’s safe to say that we need friends in our professional lives just as much as we do in our personal ones.

But if you’ve recently been promoted into your first managerial role, you understand that having close friends at work can also be complicated. Before, you and your friends complained about the boss behind his or her back. Now, you’re the boss, and they’re complaining about you behind your back. They might expect preferential treatment, and other employees will worry about favoritism. When Davidson College professor Scott Tonidandel, his former student Paige Logan, and I examined the leadership challenges of nearly 300 first-time managers, we found that the transition from BFF to boss — what we labeled “adjustment to people management/displaying authority” — was the biggest hurdle, cited by almost 60% of respondents. As one first-time manager said:

“It’s hard for me to adjust to managing people who used to be my coworkers. Sometimes I feel that people don’t take tasks and projects as seriously as they should because they think they can use their friendly relationship with me to their advantage. I’m having a hard time drawing this line because we used to work at the same level.”

Interestingly, these concerns seem to fall away as leaders move up in the ranks. When, in my own research, I asked middle managers from around the world about their most common work worries, navigating the friend-to-boss transition didn’t even make it into the top 10. Center for Creative Leadership (CCL) research shows that C-level executives are also focused elsewhere – on pressures related to boundary spanning, leading across multiple groups, organizational performance and talent management. In short, they have bigger problems to tackle. First-time managers, by contrast, have fewer responsibilities and are unaccustomed to leadership roles so they feel the psychological effects of shifting workplace dynamics much more acutely.

What can they do to overcome this challenge? Here’s what I tell the executives I train at the CCL:

Be clear. Yes, you can still be friends with your subordinates. But everyone needs to realize that your work relationship has changed. Set clear expectations and boundaries. For example, talk with your friends about the new responsibilities you face. Explain that you are accountable for the development and performance of your friends and that of their coworkers. To be an effective leader for the entire group, the amount of time you spend with them and the tenor of your interaction will probably have to change.

Be fair. When it comes to bonuses, raises, promotions, support, and resources, leave your personal biases aside. If your friends deserve them, and it’s documented, great. If not, and your friends are still rewarded, then gossip, politics, and distrust will follow.

Be aware. When you have your “supervisor hat” or “leadership t-shirt” on, all eyes are on you. So pay close attention to the signals you’re sending. How much time, energy, and resources are you giving your friend compared to others? Ask your own boss or a trusted mentor to observe and provide feedback.

Be prepared. My psychology professor at Emory University, Steve Nowicki, taught me that relationships have a four-stage life cycle: choice—beginning—deepening—ending. When you go from friend to boss, the friendship as you’ve known it has ended. You and your friend must choose whether it will begin again in this new phase. If he, she, or you can’t adjust, move on. But don’t burn bridges. You never know who may be leading you one day.

Bill Gentry, Ph.D., is a senior research scientist at the Center for Creative Leadership. Follow Bill on Twitter: @Lead_Better.