Alphabet shed nearly 5 percent Tuesday after reporting first quarter earnings Monday, as Wall Street analysts warned of a less profitable near-term for the tech giant.

Shares closed at $1022.64 after hitting an intraday low of $1012.86.

Google tripled its capital expenditures in the first quarter, highlighting investment in facilities and data centers.

Analysts are generally bullish on the strategy, but keeping a close eye on margins.

"Top-line outperformance coincides with aggressive investment, and that's a good thing," analysts for Baird wrote in a note.

Margins remain under pressure, though, as Alphabet ups spending in research and development, real estate and headcount, Baird said.

"Importantly, we believe these are necessary for innovation and to sustain long-term growth," the analysts said.

The company is building out its investment in cloud computing, placing it in more direct competition with Amazon and outlining a path forward for the company beyond advertising revenue.

"GOOG sounds like AMZN," analysts for Macquarie wrote in a note. "It sees very large opportunities for long-term growth (search, YouTube, Cloud, cars, health, etc…) and it is going to invest in them. This is absolutely the correct thing to do and will over the long term increase shareholder value."

"GOOG is clearly still doing the right thing and investing for the future, but that is a lower margin future," Macquarie said.

Tuesday's drop pushed Alphabet into the red for 2018. The stock is still up more than 15 percent in the 12-month period.