Tesla Inc., by far the worst performer on the NASDAQ Composite this year, on Tuesday staged a surprising rally to post its best trading day thus far this year.

The company’s stock closed at $193.60, up 8.17 percent, and was trading at $194.21 in after-hours. It opened at $181.10. The stock, however, stood at $205 last Tuesday.

The respite gained by the stock prevented it from sinking to $180, a level it’s not plumbed since November 2016. The stock fell below $200 for the first time since December 2016 during intraday trading on May 27.

Despite this warm news, Tesla is down 42 percent for the year and has fallen so far from its record high in September 2017 it's considered a good buy by some analysts. Nonetheless, Tesla’s stock jump added more than $2 billion to its market cap, which now stands at $34.2 billion.

Beclouding this otherwise bright development are lingering concerns over Tesla’s massive spending, its shortage of cash, dwindling demand for its aging electric vehicles (EVs) and high tariffs on goods imported from China.

Tesla has “undershot by such an amount that actually it’s so bad, it’s good,” said Carter Worth, a technical analyst at market research firm Cornerstone Macro LLC, on CNBC's "Fast Money."

Last week, Tesla’s market cap fell below that of its sister firm, SpaceX, an indication of the hard times pummeling Tesla. Buoyed by a spate of morale-boosting news, including the launch of its first 60 Starlink satellites, SpaceX rocketed to a valuation of $33.3 billion compared to Tesla's $32.8 billion.

Musk is the largest shareholder and CEO of both companies. He owns a 54 percent stake in SpaceX and owns more than 20 percent of Tesla.

Tesla’s dire straits, however, has led some analysts to predict its bankruptcy within 2020 at the earliest. Morgan Stanley is so downbeat on Tesla it predicted Tesla's stock will sink to $10 per share.

On a more positive note, Tesla CEO Elon Musk this week said the Model Y compact SUV will go into production by 2020. Musk at a recent podcast proclaimed a cheap $49,000 price tag for the Model Y.

elon musk
Elon Musk, co-founder and Chief Executive Officer of Tesla Inc., speaks at an unveiling event for The Boring Company Hawthorne test tunnel. Musk and SEC are going to court next week. Robyn Beck-Pool/Getty Images