Facebook’s top executive in charge of all products, Chris Cox, the longtime confidant of chief executive Mark Zuckerberg, is leaving the company, the highest-level departure at the tech giant amid a controversial shift to combine its various social media platforms.

Cox’s unexpected departure, which he and Zuckerberg announced in separate Facebook posts Thursday, comes months after Cox was promoted in a major reorganization. In May, Cox was put in charge of Facebook’s “family of apps,” including Instagram, Messenger, WhatsApp and Facebook itself — which together have over 2.7 billion users worldwide. These apps have been distinct until recently, when Zuckerberg announced plans to unify them with a new focus on privacy.

“It is with great sadness I share with you that after thirteen years, I’ve decided to leave the company,” Cox wrote in his post. “Since I was twenty-three, I’ve poured myself into these walls. This place will forever be a part of me.” Cox didn’t offer any explanation for his departure.

Another longtime executive exited on Thursday, who also moved upward in the reorganization last May: Chris Daniels, who took over WhatsApp after running Internet.org, the company’s philanthropic project to promote global Internet access.

WhatsApp’s embrace of encryption is the blueprint for privacy that Zuckerberg said last week he wanted to apply to all of Facebook’s networks.

“At this point, we have made real progress on many issues and we have a clear plan for our apps, centered around making private messaging, stories and groups the foundation of the experience, including enabling encryption and interoperability across our services,” Zuckerberg wrote. “As we embark on this next major chapter, Chris has decided now is the time to step back from leading these teams.”

A person familiar with discussions at the company said Cox and Daniels objected to unifying the apps.

Zuckerberg portrayed the shift to private communications as being driven by how people want to communicate — but moving the spotlight away from the public sharing that Facebook pioneered could also help paper over the fundamental problem of stagnant user growth and less time spent on the platform. The internal concern over the warning signs at the core Facebook product coincided with nearly two years of sustained crises externally around privacy and data issues.

In his blog post, Zuckerberg said Cox had told him several years ago that he planned to move but that Cox decided to hold off on leaving until the company made more progress combating misinformation and Russian interference — controversies that erupted in the wake of the 2016 election.

“At this point, we have made real progress on many issues and we have a clear plan for our apps, centered around making private messaging, stories and groups the foundation of the experience, including enabling encryption and interoperability across our services,” Zuckerberg wrote. “As we embark on this next major chapter, Chris has decided now is the time to step back from leading these teams.”

Zuckerberg said he does not plan to replace Cox. The role of integrating the apps will go to another longtime Zuckerberg deputy and former head of growth, Javier Olivan, he said in his post.

The company is facing multiple federal investigations over data privacy, stagnating user growth in its most lucrative markets, and a record-low reputation with the public. It is also embarking on a major reshuffling of its leadership.

Cox, who dropped out of a Stanford University graduate degree program to work with Zuckerberg when the company had just 15 engineers, was widely seen as one of the most popular and capable executives at the social network — and a potential replacement CEO, were Zuckerberg to leave. (Zuckerberg has said he has no plans to do so.)

Perhaps more than anyone else at Facebook — even more than Chief Operating Officer Sheryl Sandberg — Cox was a sounding board for Zuckerberg on product ideas. He launched Facebook’s flagship scrolling news feed nearly a decade ago and ran human resources before he was promoted to run the Facebook app in 2014.

Cox is one of many senior executives to leave Facebook since the controversies erupted. The company’s head of policy Elliot Schrage, its general counsel Colin Stretch, its chief security officer Alex Stamos, along with the heads of WhatsApp and Instagram and its top communications executive, have all announced their exits from the company in the last year or so, among others.

Some of the executives, such as the founders of WhatsApp and Instagram, were relatively new to Facebook, having joined when their startups were acquired, and clashed with Zuckerberg over the direction of the apps.

But the highest profile departures, including Cox, are people in Zuckerberg’s inner circle who have been at Facebook since the earliest days of the company and became fabulously wealthy after the social network’s $104 billion public offering. The past two years have been the most trying in their careers, and some are ready to move on, according to several former employees.

Cox hinted at the challenges of recent years in his goodbye post. “For over a decade, I’ve been sharing the same message that Mark and I have always believed: social media’s history is not yet written, and its effects are not neutral,” he wrote. “It is tied up in the richness and complexity of social life. As its builders we must endeavor to understand its impact — all the good, and all the bad — and take up the daily work of bending it towards the positive, and towards the good.”