Tesla got a boost Friday from one of its biggest Wall Street skeptics, who now sees Elon Musk's electric car company headed to a nearly profitable second-quarter earnings report.

Barclays, which has an underweight rating and a $150 price target on Tesla shares, raised its forecast for the company's second-quarter report to a loss of 16 cents a share — a jump from the firm's previous estimate of a loss of 71 cents a share. Tesla reports its quarterly earnings Wednesday.

"Increasing 2Q estimates as TSLA did indeed 'move the metal,'" Barclays analyst Brian Johnson said in a note to investors.

Tesla shares rose 0.6% in Friday's premarket from its previous close of $253.54.

Its stock surged in early July after Tesla reported a record second-quarter deliveries number. At the time, Johnson called the number "impressive" but said Tesla would have to show that it's improving profitability, urging investors to focus on the second-quarter earnings report. But the stock has climbed nearly 13% since the the deliveries update, a fact that Johnson highlighted in his note.

"While we were not overly surprised by the swing trade going into the delivery report, and the reaction thereafter, we are somewhat surprised by the continued strength" of Tesla shares, Johnson said.

Additionally, while Barclays reiterated that it is "fundamentally bearish" on Tesla, the analyst said Tesla has "likely raised enough cash to make it through 2020, even with below guided deliveries." That marks a noted shift in Johnson's view from earlier this month, when he said Tesla may need to raise more capital "as soon as next year" if it is going to "maintain an accelerating growth narrative."

– CNBC's Michael Bloom contributed to this report.