Tesla Inc. plans to raise about $2 billion through debt and stock offerings, after Elon Musk overestimated the ability of the Model 3 sedan to generate enough cash for the company to be self-sustaining.

The electric-car maker filed Thursday to sell $1.35 billion in convertible notes and about $650 million in shares. Tesla stock, which had plunged 30 percent this year, rose 2 percent to $238.65 at 10:09 a.m. in New York, and its bonds advanced.

“We view this as a clear net positive for Tesla,” Dan Ives, an analyst at Wedbush Securities, said in a note. The electric-car maker needed to “take its medicine and clear the air of the very real investor worries.”

Tesla’s chief executive officer said on several occasions last year that Tesla would no longer need to raise capital as its first mass-manufactured car ramped up. Musk changed his tune after the first quarter, when a record decline in vehicle deliveries and the company’s biggest-ever debt payment depleted its cash balance to a three-year low of $2.2 billion.

Musk, 47, will participate in the offering by buying as much as $10 million in stock. Tesla hired Goldman Sachs Group Inc., Citigroup Inc., Bank of America Corp., Deutsche Bank AG, Morgan Stanley, Credit Suisse Group AG, Societe Generale SA and Wells Fargo & Co. to underwrite the share offering, according to the filing.

Most of the offering will come in the form of convertible bonds due 2024, per the filing. The securities are being marketed with a coupon of between 1.5 percent and 2 percent, according to people with knowledge of the matter. The conversion premium is being talked at a range of 27.5 percent to 32.5 percent, said the people, who asked not to be identified discussing the private deal terms

It’s not yet known how many shares the banks plan to purchase. Tesla said the total proceeds of the offerings could be about $2.3 billion if underwriters fully exercise their option to purchase additional securities. The offering is expected to price after the market close.

Tesla’s 5.3 percent bonds due 2025 were among the best performers in the U.S. high-yield market Thursday morning in New York, rising almost 2 cents on the dollar to 87.5 cents, according to Trace. Credit default swaps tied to the debt rallied the most since October. It now costs about $1.5 million upfront to insure $10 million of Tesla bonds against a default for five years, down from $1.7 million Wednesday.

After reporting a loss per share that was double what Wall Street expected, Musk sought to assure investors on Tesla’s April 24 earnings call that the company would return to profitability in the third quarter. He told analysts there was “merit to the idea of raising capital” to expand.

A raise of around $2 billion is in line with what several Tesla analysts were expecting. An infusion of that amount would get Tesla closer to a ratio of 15 percent of cash to sales, a historical level among traditional auto manufacturers and suppliers, according to Bloomberg Intelligence analyst Joel Levington. Tesla has stayed at around half that level, he said.

Tesla is planning as much as $2.5 billion in capital expenditures this year as it develops new vehicles including the Model Y crossover, Semi truck and Roadster sports car. It’s also building a battery and vehicle factory near Shanghai where it plans to begin producing Model 3s later this year.

(Updates with convertible bond terms in the sixth paragraph.)

–With assistance from Drew Singer and Claire Boston.