Mark Zuckerberg, chief executive officer and founder of Facebook, holds his phone after the morning session at the Allen & Co. Media and Technology Conference in Sun Valley, Idaho, July 13, 2018.

Facebook's "investments in 2019 could be larger than anticipated in consensus estimates. We expect the narrative of heavy investment spending to continue at 3Q earnings," analyst Doug Anmuth said in a note to clients Tuesday. "Safety and security, around which FB will add 20k+ heads this year, will fall across multiple opex lines, but comes with little/no immediate revenue return."

The firm lowered its price target to $195 from $205 for Facebook shares. J.P. Morgan also reduced its 2019 earnings estimate for the company due to higher expense spending.

J.P. Morgan is getting less optimistic about Facebook due to the company's rising investment spending.

The company's shares closed down less than 1 percent to $160.30 on Tuesday. The new target still represents 21 percent upside to Monday's close.

The analyst noted that the company gave lower operating profit margin guidance on its second-quarter earnings call. Facebook said the margin will fall to the "mid-30s on a percentage basis" over a multiyear period due to increased security and content review expenses. It reported a second-quarter operating margin of 44 percent.

"We expect FB to also invest more in innovation areas as it looks to develop bigger long-term bets around AR/VR, and possibly payments and blockchain among other areas," he said.

As a result, Anmuth lowered his Facebook 2019 earnings per share estimate to $7.40 from $7.89.

Despite his forecast reduction, he reiterated his overweight rating for Facebook shares due to the company's social media market leadership.

Facebook shares are underperforming the market this year. Its stock is down 9 percent year to date through Monday versus the S&P 500's 8 percent return.

The company did not immediately respond to a request for comment.