Social games maker Zynga announced Monday what it called painful plans to cut 18 percent of its workforce, the biggest layoff in the company's short history.

Zynga is trimming 520 of its total of about 2,900 workers and closing game development studios in Los Angeles, Dallas and New York. The company also revised its second-quarter projections and now expects a slightly larger than expected net loss of $28.5 million to $39 million.

Once one of San Francisco's fastest-growing tech firms, Zynga said in a news release that while its franchise "FarmVille" games continue to do well, other games are underperforming.

The company expects the move to save about $70 million to $80 million in annualized pretax expenses. But the news, released with more than an hour left of trading on the Nasdaq, sent Zynga's stock price tumbling by 12 percent.

"Today is a hard day for Zynga and an emotional one for every employee of our company," Chief Executive Officer Mark Pincus wrote in an e-mail sent to workers and later posted on a company blog.

"We are saying painful goodbyes to about 18 percent of our Zynga brothers and sisters," he said. "The impact of these layoffs will be felt across every group in the company. None of us ever expected to face a day like today, especially when so much of our culture has been about growth. But I think we all know this is necessary to move forward."

Earlier layoffs

The new round of layoffs comes on top of a reduction of 155 employees in December and an additional 30 in February. The company has also shut down 18 poorly performing games and previously shut or consolidated offices in Baltimore, New York and Texas.

Zynga is expecting to incur restructuring costs of $24 million to $26 million for the second quarter and $2 million to $5 million in the third quarter.

The company has been pouring resources into developing new hit mobile games, including the sequel to the flagging "Draw Something" franchise, and titles that will appeal to "mid-core" gamers, such as "Solstice Arena."

But analyst Brian Blau, a research director with Gartner, said the latest news had him wondering: "What is really going on?"

"This is not good news," he said. "They've had layoffs before and they've already reported two consecutive quarters of disappointing earnings and disappointing revenues. I can't imagine that mobile games need any fewer resources than before, but maybe they just don't have the forecast for revenues to be able to support that."

Fueled by the runaway popularity of social games such as "FarmVille" and "CityVille" on Facebook, Zynga grew from just a handful of employees in 2009 - two years after its founding - to a high of about 3,200 last year, just months after going public.

In March 2012, the company even spent $228 million to buy its entire 670,000-square-foot building at Eighth and Townsend streets, anticipating the need to accommodate more employees.

Players go mobile

But declines in revenue from the sale of virtual goods within its social games, a drop in the number of players and an overall shift of players to mobile games have hurt Zynga's fortunes.

Zynga had about 1,700 employees based in San Francisco, but would not say how many employees here will be affected by the latest layoff round.

The mood inside and outside of Zynga headquarters was somber Monday afternoon.

The staff reductions are expected to be completed by August. In his note, Pincus said the company is "offering generous severance packages."

"Because we're making these moves proactively and from a position of financial strength, we can take care of laid off employees," he wrote.

Pincus also said he was encouraged by the progress of recent titles such as "Running With Friends," which garnered 22,000 players in less than a month.

"Our 'FarmVille' franchise teams continue to innovate and deliver groundbreaking new social experiences like 'County Fair' which, despite only being available on the web, is engaging 39 million monthly players."

Rocky transition year

Zynga did post a slight profit in the most recent quarter, although it warned investors this would be a rocky transition year.

"I didn't expect them to cut this deeply, but admire them for it," said analyst Michael Pachter of Wedbush Securities. "It is a hard decision, but it shows that management is serious about being profitable. Their revenues aren't dropping very fast. I think they are going to be fine, but it might take a while to find that next hit."