SHANGHAI — The company’s name appeared in ads for the local marathon. Its logo was emblazoned on the jerseys of two professional soccer teams in Spain. Its founder had been lauded by the government’s official television channel.

To investors, it seemed like a safe bet. For years, it was. Then some of them tried to take their money out.

Now as much as $5 billion is missing, the head of the company is in jail and in one city, angry investors took to the streets.

Online investing in China isn’t for the vulnerable or the naïve — but frequently, that’s exactly who it draws. The flameout last week of the popular online investment portal Qianbao is the latest in a string of collapses that has devastated small investors and prompted Beijing to take steps to tamp down on potential unrest.

The pitches frequently appeal to aspiring small investors like Walter Xu, a recent university graduate who was drawn to Qianbao by promises of sky-high returns. Qianbao looked like a real business: Its portal sold cellphones and appliances — with discounts for members — as well as big returns for those who gave it money. In exchange for depositing money, watching ads and writing reviews, it offered returns of as much as 50 percent. In all, Mr. Xu invested $32,000 of his savings in Qianbao.

On Dec. 26, when Qianbao’s founder turned himself over to authorities, Mr. Xu turned to fellow investors on WeChat, China’s popular social messaging platform, to commiserate. “I talked until 3 in the morning,” he said. “I was shocked.”

Now, he said, he must put the episode behind him. “I need to work and start over,” he said.

Some investors who lost their savings in Qianbao protested last week in the city of Nanjing, where the online investment platform had been based. Police acted swiftly, detaining the organizers of the demonstration and giving others warnings, according to a notice by the Nanjing police. Government censors appeared to have taken down some discussions about Qianbao on social media and removed some news articles about it.

China has been rife with investment frauds in the decades since its economic reopening led to a boom. But online versions have the potential to reach more people in a country with more than 700 million internet users, many of whom now conduct most of their financial transactions on smartphones.

Investors in online products are often drawn by promises of high rates of return and the idea that the investments are safer than China’s stock market, which has long had a reputation for casino-like uncertainty. But they are often unsophisticated investors who are unaware of the risks, experts warn.

“If you are earning 10 or 11 percent on an investment product, you should know that you are taking on a high amount of risk,” said Michael Pettis, professor of finance at the Guanghua School of Management at Peking University and a senior associate of the Carnegie Endowment for International Peace.

“It’s not clear to me that investors understand that they are taking on this risk,” he added.

In some instances Qianbao promised investors returns as high as 80 percent. Such promises are easy to come by in China.

Conglomerates and fly-by-night companies alike have turned to new online platforms to raise money if they can’t get credit from banks. Often the pitches are long on promises but short on accountability.

Just four months ago, a Beijing court handed down a lifetime prison sentence to the founder of a $9 billion online lending platform called Ezubao that authorities now say had been a Ponzi scheme. Last summer, Chinese police arrested the head of Fanya Metals Exchange, which offered investment products promising double-digit returns, after it lost $6 billion of investor money. One month later, investors in a company called Shanxinhui lost billions of dollars and many hundreds of protesters took to the streets. In response to protests in Beijing at the time, Guo Shengkun, then China’s police chief, pledged to rein in fraudulent financial schemes.

In a country where everything is tightly managed by the government, many investors believe that the government will take steps to make sure investors get their money if something goes wrong.

“The big difference between China and U.S. consumer finance is the Chinese have implicit faith that someone in government will step in if any products or companies default,” said Andrew Collier, the founder of research firm Orient Capital Research.

Qianbao — whose name translates to money treasure — possessed a veneer of credibility. Local officials attended its events. It sponsored the Nanjing Marathon and two Spanish soccer teams, Real Sociedad and Rayo Vallecano. Qianbao’s founder, Zhang Xiaolei, was even profiled by China Central Television, the government’s official broadcaster, the ultimate sign of success.

Over its six years, Qianbao collected money from as many as 200 million users who deposited their money into the website, raising $5 billion in deposits, according to the state-run news agency Xinhua. In order to earn interest on their deposits, investors were told they had to participate in promotional activities like watching ads, posting information about various products on social media and filling out questionnaires. The website also provided a platform for retailers for their products, which members could buy.

Then its founder turned himself in, with state-run media saying he took the step after the company drew attention from officials. Mr. Zhang and his company are now being investigated by the authorities in Nanjing.

“I have taken in money from new investors to pay old investors,” Mr. Zhang said in a handwritten statement published by the Nanjing police.

“I cannot pay back the principal and interest and I am very sorry about the loss to investors,” he added. An email to the company’s public relations officials seeking comment bounced back unanswered.

More recently, when Mr. Zhang was interviewed by a local television network, he said he had spent three years preparing for the day that he would turn himself in. “I need to take legal responsibility,” he said.

Kimi Wang, who watched the protests in Nanjing from a nearby government building, said he had deposited about $79,000 into Qianbao. All of it, he said, was gone.

Many investors in Qianbao were told that the more money they put in, the higher the returns would be. Mr. Wang borrowed from an online cash lender and friends in order to add to his investment. It was the equivalent of seven or eight years of income for Mr. Wang, who does odd jobs like drive for the ride-sharing company Didi Chuxing.

The damage, he said, is widespread. “Every Nanjing local has a relative or friend that used Qianbao,” he said.