(Reuters) - Shares of Google parent Alphabet Inc lost more than 5 percent on Tuesday as a surge in costs drove what analysts said was its biggest ever contraction in gross margins, overshadowing strong first-quarter ad sales.

FILE PHOTO: The Alphabet Inc. campus, also known as Googleplex, is shown in this aerial photo in Mountain View, California, U.S., April 6, 2016. REUTERS/Noah Berger/File Photo

The dive in first-quarter operating margins, to 22 percent from 27 percent a year ago, follows a troubling six weeks for major U.S. tech players, now facing a more questioning public and the prospect of tighter official scrutiny on privacy issues.

The fall in Alphabet shares following its first-quarter results on Monday evening turned them negative for the year and amounted to a roughly $37 billion reduction in the value of the Mountain View, California-based firm.

Other members of the FAANG group of tech stocks that include Amazon.com Inc, Facebook Inc , Netflix Inc and Apple Inc also tracked that move lower.

At least nine brokerages cut their price targets on Alphabet shares, compared to five who raised.

But analysts were reluctant to place the blame as yet on the row over user data which has engulfed Facebook and threatens to encourage more regulation of internet companies.

“There is regulatory risk, though we have yet to find evidence that regulations will adversely impact the usefulness of Google for consumers or advertisers,” RBC analysts said.

Longer-term capital expenditures at Google nearly tripled to $7.3 billion in the first quarter from $2.5 billion a year ago.

The company said that continuing cost increases came from acquiring streaming rights for YouTube’s new TV service and marketing new products.

Google executives say the spending to install powerful computers and internet cables is necessary to keep up with demand for YouTube, its Google Assistant virtual helper service and data analytics tools within its Google Cloud services.

“With YouTube’s rapid growth (also in non-ad-supported services) and a greater emphasis on hardware made by Google, we think this gross margin contraction will continue,” Canaccord Genuity analyst Michael Graham wrote in a client note.

“Gross margin contracted ~370 bps y/y, (that is) the largest contraction in company history.”

Ad sales also suggested that there were no immediate signs of the privacy concerns affecting profits.

Alphabet’s shares have risen 25 percent in the past year, making it the third best performing of the FAANG group, trailing only Amazon and Netflix.

The sharp declines in FAANG stocks pushed the S&P 500 and Nasdaq Composite lower on Tuesday afternoon.

Facebook and Amazon were each off nearly 4 percent, Netflix dipped 5 percent and Apple shed 1.6 percent.

The technology sector sank 1.47 percent, making it the biggest drag on the S&P 500 and the Nasdaq Composite. [.N]

(This story has been refiled to correct spelling of Canaccord Genuity in paragraph 10.)