SAN FRANCISCO -- After building a social network that turned into a surveillance system, Facebook CEO Mark Zuckerberg says he's shifting his company's focus to messaging services designed to serve as fortresses of privacy.

Instead of just being the network that connects everyone, Facebook wants to encourage small groups of people to carry on encrypted conversations that neither Facebook nor any other outsider can read. It also plans to let messages automatically disappear, a feature pioneered by its rival Snapchat that could limit the risks posed by a trail of social media posts that follow people throughout their lives.

It's a major bet by Zuckerberg, who sees it as a way to push Facebook more firmly into a messaging market that's growing faster than its main social networking business. It might also help Facebook ward off government regulators, although the Facebook CEO made clear that he expects the company's messaging business to complement, not replace, its core businesses.

But there are plenty of obstacles. Facebook has weathered more than two years of turbulence for repeated privacy lapses, spreading disinformation, allowing Russian agents to conduct targeted propaganda campaigns and a rising tide of hate speech and abuse. Zuckerberg submitted to two days of grilling on Capitol Hill last April. All that increases the challenge of convincing users that Facebook really means it about privacy this time.

Encrypted conversations could alleviate some of those problems, but it could make others worse. Security is an "admirable goal," said Forrester Research analyst Fatemeh Khatibloo. "I'm just not sure it addresses the bigger issues Facebook is facing right now."

Facebook grew into a colossus by vacuuming up people's information in every possible way and dissecting it to shoot targeted ads back at them. Anything that jeopardizes that machine could pose a major threat to the company's share price, which would also affect its ability to attract and retain talented engineers and other employees.

In a Wednesday interview with The Associated Press, Zuckerberg predicted Facebook's emphasis on privacy will do more to help the company's business than hurt it. While most of the stock market slipped in Wednesday trading, Facebook's shares gained $1.25 to close at $172.51.

The Facebook CEO has been telegraphing some of these changes to investors for the past six months, but his Wednesday blog post is the first time he has explained the idea to the more than two billion people that use Facebook's services and look at its ads. Those ads are expected to generate $67 billion in revenue this year, according to the research firm eMarketer.

If everything falls into place, Facebook will also display similar advertising on the privacy-protected messaging services. Those services are also likely to offer other moneymaking features, such as a digital wallet, as Facebook attempts to build something similar to Tencent's popular WeChat service in Asia.

"If you think about your life, you probably spend more time communicating privately than publicly," Zuckerberg said during the AP interview. "The overall opportunity here is a lot larger than what we have built in terms of Facebook and Instagram."

That's far from proven. While Facebook has already tried to show ads in the Messenger app, it's seen only limited success. It hasn't even tested the concept in WhatsApp since it acquired that service for $22 billion in 2014.

"There are some huge unknowns about how successful Facebook is going to be rolling advertising into a more private messaging environment," said eMarketer analyst Debra Aho Williamson.

Some critics are convinced that Facebook has become so powerful -- even a threat to democracy as well as to people's privacy -- that it needs to be reined in by tougher regulations or even a corporate breakup.

But unraveling Facebook could become more difficult if Zuckerberg can successfully stitch together the messaging services behind an encrypted wall.

"I see that as the goal of this entire thing," said Blake Reid, a University of Colorado law professor who specializes in technology and policy. He said Facebook could tell antitrust authorities that WhatsApp, Instagram Direct and Facebook Messenger are tied so tightly together that it couldn't unwind them.

Combining the three services also lets Facebook build more complete data profiles on all of its users. Already, businesses can already target Facebook and Instagram users with the same ads, and marketing campaigns are likely coming to WhatsApp eventually.

Facebook's focus on messaging privacy raises other concerns. Messaging apps have in the past helped fake news and rumours spread fast, sometimes with deadly consequences. A report from University of Oxford researchers last year found evidence of widespread disinformation campaigns on chat applications like WhatsApp. In one particularly brutal example, the Indian government last year accused WhatsApp of fueling rumours that led to lynchings and mob violence that wounded dozens.

Facebook responded by restricting the number of groups to which a message could be forwarded and labeling forwarded messages as such. On Wednesday, Zuckerberg said that Facebook needs to protect both privacy and safety as it encrypted messaging services, although he noted to an "inherent trade-off" between security and safety, simply because Facebook won't be able to read encrypted conversations.

And in some cases, Facebook could allow some content to automatically disappear in a day or two, as if it were a fleeting mirage.

"Some people want to store their messages forever and some people think having large collections of photos or messages is a liability as much as it is an asset," Zuckerberg told the AP. "Figuring out the balance is a really important one."

------

AP technology writers Anick Jesdanun, Tali Arbel and Mae Anderson contributed to this article from New York.