(Reuters) - Tesla Inc’s (TSLA.O) outspoken CEO Elon Musk on Wednesday called sweeping U.S. stay-at-home restrictions to curtail the coronavirus outbreak “fascist” as the electric carmaker posted its third quarterly profit in a row.

His remarks overshadowed an otherwise successful quarter that took many investors by surprise as automaker peers were hit by a slump in consumer demand and forced factory shutdowns.

Shares of the company were up 8.8% at $871 in extended trade.

Tesla’s profitable quarter comes just a day after Detroit-based rival Ford Motor Co (F.N) reported a $2 billion first-quarter loss and forecast losing another $5 billion in the current quarter as the coronavirus pandemic hits demand.

General Motors Co (GM.N) on Monday suspended its dividend and share buybacks and will report earnings May 6.

How Tesla fares in the current quarter and the remainder of the year will be an important test of the company’s durability. If Tesla can limit its losses, or even continue its profit streak and outperform legacy automakers, it will be in a stronger position to take sales from rivals weakened by the coronavirus disruption.

Tesla produces a fraction of the cars of its rivals but has a much larger stock market value on expectations of tremendous growth.

On the biggest disruptions to Tesla has been the government-ordered shutdown of its factory in Fremont, California, which sits idle since March 24 with stay-at-home orders running until at least May 31.

On a conference call on Wednesday, Musk said he did not know when Tesla could resume production in California and called the state stay-at-home order a “serious risk” to the business.

“To say that they cannot leave their house and they will be arrested if they do, this is fascist. This is not democratic, this is not freedom. Give people back their goddamn freedom!”

Late on Wednesday, the Tesla CEO doubled down on his stance, in response to a journalist’s tweet that quoted Musk’s remarks of calling the stay-at-home orders fascist. “Hell yeah!!”, Musk said on Twitter.

Musk tweeted on March 6 that “the coronavirus panic is dumb” but later offered to supply hospitals with free ventilators.

Tesla said it could not predict how quickly vehicle manufacturing and global supply chains will normalize, saying it would revisit full-year guidance for net income and cash flow when it reports current-quarter results in three months.

Musk said that while other carmakers were cutting back, Telsa was ramping up investment. He said Tesla might announce the location of a new U.S. factory in one to three months.

FILE PHOTO: SpaceX owner and Tesla CEO Elon Musk arrives on the red carpet for the automobile awards "Das Goldene Lenkrad" (The golden steering wheel) given by a German newspaper in Berlin, Germany, November 12, 2019. REUTERS/Hannibal Hanschke

Tesla in January said it expected positive quarterly cash flow and positive net income going forward. The company on Wednesday did not update its previous forecast of delivering half a million vehicles by the end of 2020.

The COVID-19 pandemic caused by the new coronavirus has disrupted demand for cars, with automakers including Tesla forced to furlough workers and close factories.

Vehicle demand in the United States has dropped as much as 80% in some hard-hit areas in March, but some analysts said sales appeared to recover slightly in April.

Tesla on Wednesday said it expected production at its vehicle factories in Fremont, California and in Shanghai, China to ramp up gradually through the second quarter.

The company said operations at its Shanghai plant were progressing better than expected, with production rates of its Model 3 sedan expected to hit 4,000 units per week, or 200,000 per year, by mid-2020.

Company-wide automotive gross margins in the first quarter jumped to 25.5%.

But of the $5.1 billion in overall automotive revenue, nearly 7% were due to regulatory credits - money Tesla receives from other automakers that buy the company’s carbon emissions credits to meet stricter regulation. Revenue from those credits nearly tripled from the last quarter.

Hargreaves Lansdown analyst Nicholas Hyett also flagged that Tesla’s free cash flow was negative last quarter and improved only modestly on a yearly basis.

“The immediate future doesn’t look like the ideal time to be selling premium priced cars, so perhaps it’s no surprise guidance has been paused,” Hyett said.

Tesla said its free cash flow had been impacted by growing inventory due to coronavirus shutdowns.

Tesla shut down the California factory just as it was ramping up production of its new electric crossover utility vehicle Model Y, which it expects to generate record demand and higher profit margins.

Tesla on Wednesday said the Model Y was already contributing profits, marking the first time in the company’s history that a new vehicle is profitable in its first quarter.

Excluding items, Tesla posted a profit of $1.24 per share. Analysts had expected a loss of 36 cents per share.

Tesla shares are up 91% for the year to date as of Wednesday’s close, after recovering from a sharp slump in March.

Slideshow (2 Images)

The Tesla CEO in particular appeared critical of the coronavirus-related restrictions in California as he agreed with a tweet suggesting the state’s hospitals were laying off staff and going bankrupt. He also referenced data saying hospitals in California “have been half empty”.

Musk seemed to be supportive of the way the lockdown was being lifted in Germany as the European nation began to gradually and tentatively reopen.

“Very sensible,” Musk tweeted late on Wednesday responding to a media report on how Germany was lifting its restrictions.

Reporting by Akanksha Rana in Bengaluru and Tina Bellon in New York; additional reporting by Kanishka Singh; Editing by Joseph White, Lisa Shumaker and Gerry Doyle