Facebook said on Wednesday that a federal investigation into its privacy practices could cost the company as much as $5 billion.

In its quarterly results reported to investors, Facebook said that for now it was setting aside $3 billion to pay in potential penalties to the Federal Trade Commission but that the eventual number could be much higher by the time the FTC’s investigation is over.

“We estimate that the range of loss in this matter is $3.0 billion to $5.0 billion. The matter remains unresolved, and there can be no assurance as to the timing or the terms of any final outcome,” the company said.

The FTC said last year it was investigating reports that the British consulting firm Cambridge Analytica improperly gained access to the data of tens of millions of Facebook users, seven years after Facebook agreed to improve its privacy practices to settle an earlier dispute with the FTC.

The commission is also weighing whether and how to hold Facebook CEO Mark Zuckerberg personally accountable for mismanaging users’ private data, two sources familiar with the discussions told NBC News last week.

Shares rose about 8 percent in after-hours trading following Facebook’s announcement.

The share price rise was seen by some as proof that even a multi-billion-dollar fine against Facebook was too light a punishment for the company's perceived transgressions.

"Last month, I said that a fine in the low billions of dollars would amount to a slap on the wrist for Facebook," tweeted Rep. David Cicilline, D-R.I. "Tonight, we learned that’s how Wall Street sees it too - as a slap on the wrist. If the FTC won’t act, Congress has to."

Facebook did not say how close it was to a possible settlement agreement with the FTC. Bloomberg News reported on Wednesday that the company was in “advanced talks” with a group of state attorneys general to resolve a parallel investigation by them.

The company said it had $45.2 billion in cash, cash equivalents and marketable securities at the end of March.

On a conference call with Wall Street analysts, Chief Financial Officer Dave Wehner was asked how an FTC case might force changes to Facebook’s business model. He declined to comment. “Can’t really comment further, as this is an ongoing matter,” he said.

The FTC can bring injunctions in addition to monetary penalties, said Ashkan Soltani, a former FTC chief technologist. “Depending on the injunctions, they may impact certain ad practices,” Soltani said on Twitter.

For example, Soltani said, the FTC might want to restrict the ability of Facebook to use data — such as a person's address book for ad-targeting purposes — if Facebook collected that data for an entirely different reason.

The possible FTC penalty “is not expected to be tax-deductible,” the company added in a footnote.

Facebook said in its results that its platform had 2.38 billion monthly active users worldwide at the end of March, an increase of 8 percent from a year earlier.

It reported revenue for the first three months of the year of $15.1 billion, an increase of 26 percent from the same period a year earlier.

Zuckerberg told analysts on the conference call that Facebook would spend much of the next five years focusing on a shift toward private encrypted messaging, with less of an emphasis on the public posts and news feeds that have been at the company’s core.

He said, though, that the shift won’t have an immediate impact on the company’s ad business, telling analysts he’s “confident that won’t be a significant issue.”