How rapidly things change in Silicon Valley.

A month ago, Tesla CEO Elon Musk seemed confident the electric car maker would turn a profit in the first quarter. Now he's predicting a loss. The reversal — disclosed on a media call Thursday night — overshadowed what was supposed to be good news during a tough week of headlines: Tesla was finally unveiling its long-awaited Model 3 sedan at $35,000.

The shares, already under pressure from Musk's ongoing tussle with federal securities regulators, tanked by almost 8 percent in midday trading Friday.

To make its popular electric car at a more affordable price for consumers, Musk said the company has to trim stores, cut employees and shift sales online. It's all part of a push to profitably sell the long-anticipated (and much delayed) $35,000 variant of the Model 3, the midsize sedan Musk and company had long bet would take Tesla from a niche manufacturer to a major automaker.

On Jan. 30, Musk told investors he thought Tesla would continue making money after finally turning its first back-to-back profits during the third and fourth quarters of last year, fulfilling his previous forecast that Tesla would become "sustainably profitable" from the third quarter of 2018 onward.

"I would say at this point I'm optimistic about being profitable in Q1," Musk said on the Jan. 30 conference call discussing the company's fourth-quarter earnings. "Not by a lot, but I'm optimistic about being profitable in Q1 and for all quarters going forward."

So what happened?

Musk cited one-time charges this quarter as one major factor, though he did not specify what those are. The company has $920 million in debt due Friday, and Musk has previously said it had enough cash on hand to cover.

He also said there have been some difficulties getting cars to China and Europe.

How much money Tesla can make selling a cheaper Model 3, and whether customers will actually buy it, are major concerns among investors.

"Tesla cut the size of their battery by 30 percent to get this $35,000 base unit out the door," said Craig Irwin, an analyst with Roth Capital Partners. That is probably a reduction in cost of about $5,500 per car, Irwin said. But who wants a low-range car, he said.

"They killed the 60 kWh Model S for poor demand, and even weaker margins," he said. "It seems to dovetail nicely that 2019 will see major margin pressure," he said.

The fact that the company is moving all vehicle sales online and cutting retail jobs also suggests it is coming to the realization that many industry observers suspected all along — profitably selling a $35,000 electric car will be very difficult.

"Tesla appears to have answered the question we have long asked around whether the company was going to be able to profitably produce the $35k Model 3 through production efficiencies and increased volumes," Cowen analyst Jeff Osborne said in a note to clients Friday. "Switching the strategy now to shed stores that are the face of the brand beyond Elon Musk's Twitter feed, likely means that management has come to the realization that it was not going to be feasible."

It is also significant that this is all happening as federal tax credits for Tesla cars start to wind down, said CFRA analyst Garrett Nelson. The first 200,000 customers to buy Tesla cars received a federal tax credit of $7,500. But those were halved at the beginning of the year, after Tesla hit the limit. They will continue to be phased out by the quarter.

"I think it all goes back to the EV tax credits, which are negatively impacting sales and gross margins," Nelson said.

Red flags went up for Nelson just a few days after the New Year when Tesla said it would cut prices on its vehicles. Then the company announced it would focus on producing higher-cost exports to China and Europe, lay off workers and introduce a Model 3 leasing program, he said.

"The earnings warning just confirms these red flags, and while it's a bit early to say, it appears that the company's profitability challenges could potentially linger well beyond Q1," he said.

The announcement certainly was abrupt and did not appear to be made from a position of strength, said Bernstein analyst Toni Sacconaghi in a note Friday. But over the long term there are still several levers Tesla can pull to improve profits, including reducing sales and manufacturing costs as well as driving higher sales volume with the cheaper Model 3, its leasing programs and international expansion, he said.

"In some ways, we believe CEO Musk's recent focus on profitability each quarter may have been misplaced – and that Tesla might be best served by looking to press its brand and first mover advantage by aggressively making and distributing its cars – which yesterday's move appears to be doing," he said.