David Marcus. Facebook PayPal President David Marcus is stepping down from his position to join Facebook, where he'll work on the company's mobile-messaging products.

In a public Facebook post, Marcus writes that he has decided to leave PayPal now so that he could once again focus on building products, and "because I feel that PayPal has never been in a better position to capitalize on its unique place in the market."

Marcus joined PayPal as vice president in 2011, after it bought his company, Zong, and was promoted to president in 2012. PayPal's leadership team will report to eBay president and CEO John Donahoe until a replacement for Marcus is found.

In his Facebook post, Marcus writes that he decided to make the move after a get together with CEO Mark Zuckerberg.

"Mark shared a compelling vision about Mobile Messaging," he says. "At first, I didn't know whether another big company gig was a good thing for me, but Mark's enthusiasm, and the unparalleled reach and consumer engagement of the Facebook platform ultimately won me over. So ... yes. I'm excited to go to Facebook to lead Messaging Products. And I'm looking forward to getting my hands dirty again attempting to build something new and meaningful at scale."

According to Re/code's Kara Swisher, Marcus will be dealing with Messenger, Facebook's standalone messaging app with 200 million monthly active users, but not WhatsApp, the mobile-messaging company that Facebook bought for $19 billion in February.

It hasn't exactly been an easy year for Marcus. In February, an internal memo was leaked in which he angrily scolded PayPal employees for not using company products, and, in May, ex-PayPal director of strategy Rakesh Agrawal went on a public Twitter rampage against some PayPal employees and, eventually, the company in general.

"As the head of PayPal, David helped make a great business better, reinvigorating product design and innovation and energizing the team to deliver compelling consumer experiences," Donahoe writes.

Marcus learned to code at age 8 and started his first company when he was only 23, according to Facebook's announcement of the news.

Here's the full press release from PayPal: