PayPal CEO David Marcus is leaving the payments company to join Facebook, where he'll lead the social network's efforts in mobile messaging. eBay, the company that owns PayPal, said Marcus would leave the firm on June 27.

"We're excited by the potential to continue developing great new messaging experiences that better serve the Facebook community and reach even more people, and David will be leading these efforts", Facebook said in a blog post yesterday.

Marcus, who taught himself to write code at the age of 8, and launched his first startup at the age of 23, joined PayPal as VP of mobile three years ago when the latter acquired his mobile payments company Zong for $240 million.

He said that the decision to join Facebook came after a meeting with the social network's chief executive Mark Zuckerberg.

"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", he wrote in a Facebook post.

After Marcus leaves PayPal, the company's leadership team would report directly to eBay president John Donahoe until a new president is named.

PayPal, which has more than 148 million active accounts, in 2013 processed $180 billion in payment volume, out of which $27 billion was processed in mobile payments alone. The company accounted for 41 percent of eBay's revenue last year.

As far as Facebook is concerned, the move hints at the company's plans to start monetizing its messaging products, and with Marcus leading the efforts, payments could be the key to earning money, rather than ads. Back in April, the company applied for an e-money license in Ireland.

The news comes a few months after the world's most popular social network acquired Whatsapp, the world's most popular messaging service.