Tesla said Thursday it plans to raise up to $2 billion, with $1.35 billion coming from convertible notes and $650 million from new equity, including a big purchase from CEO Elon Musk.

In a filing, Musk signaled his intent to buy about $10 million of the electric auto maker's stock in the new offering. The total equity offering is for 2.7 million shares of Tesla. Musk's purchase would be 41,896 shares. Before the offering, Musk owned about 20% of Tesla's outstanding shares, worth about $12.6 billion, according to FactSet.

The move comes only a week after Musk deferred on questions about the company raising capital any time soon.

"I don't think raising capital should be a substitute for making the company operate more effectively," Musk told shareholders on the company's quarterly conference call. "I do think there is some merit to raising capital, but this is sort of probably about the right timing."

Musk was pressed on the topic by Wall Street analysts on the call, since Tesla burned through around $2 billion in cash in the first quarter of 2019.

Tesla shares fell in premarket trading Thursday when the company put out an initial filing indicating it would be offering a mix of debt and equity securities. The stock then reversed course and traded higher when a second filing revealed details of the offering, including Musk's interest in buying a block of the new shares. Shares closed trading up 4.3% at $244.10 a share.

Musk's purchases have been reliable short-term buy signals for the stock, according to InsiderScore.com. Following the last five purchases by Musk, the shares were higher on average by 41% in the next three months, according to InsiderScore.

Tesla shares have been under pressure lately, down nearly 30% this year. The stock's surge following the filing came from "the fact that they ripped off the Band-Aid and decided to raise the capital," Dan Ives, managing director of equity research at Wedbush Securities, told CNBC.

"There was growing fears that this company was going to need incremental cash going to the second half of the year. For the first time, they listened to investors and the math doesn't lie in terms of what they needed to do," Ives said. "Now there's a relief because the liquidity issue and the finance concern could be put to rest in the near term."

The offering is being underwritten by Goldman Sachs, Citigroup, Bank of America, Deutsche Bank, Morgan Stanley, Credit Suisse, Societe Generale and Wells Fargo.

– CNBC's Yun Li contributed to this report.