Tesla plans to sell up to 3 million additional shares in an effort to take advantage of the massive rally in its stock price.

The offering, disclosed in a filing early Thursday, would raise up to $2.3 billion for the company at Wednesday’s closing price.

Just two weeks ago CEO Elon Musk discounted the idea of an additional offering when it was suggested by stock analysts. At the time he said the company, which is now profitable, had all the cash it needed.

“We’re actually spending money as quickly as we can spend it sensibly,” Musk said on a January 29 call, when the company posted its first annual profit. “There is no artificial hold back on expenditures. Anything that I see that … looks like it’s got good value for money, the answer is yes, immediately. And then despite all that, we are still generating positive cash. So in light of that, it doesn’t make sense to raise money.”

The filing says Tesla will use the proceeds of this offering to improve its balance sheet and for general corporate expenses.

The company’s previous offerings have generally come at a time when it desperately needed cash.

Indeed, for much of the last decade the carmaker has used the public markets like an ATM machine.

In May 2019, the electric carmaker sold debt and additional shares of stock to raise $2.7 billion to replenish its coffers. Tesla’s share price was depressed at the time, which forced the company to pay off a $920 million bond in cash rather than stock.

The company said that it expects to remain profitable and cash-flow positive going forward, but it does have some major costs coming up.

For instance, it just started production of its new Model Y SUV, which is due to be delivered late in the first quarter. And it’s picked a site in Germany for its next factory.

It’s also ramping up production at its second auto assembly plant in Shanghai. However that factory, which opened late last year, has been closed for an extended Lunar New Year holiday due to the coronavirus.

Musk intends to buy $10 million worth of shares with his own cash as part of this offering according to a filing, and Tesla board member Larry Ellison, the co-founder of Oracle and one of the world’s richest men, also intends to purchase $1 million worth of shares.

Shares of Tesla edged up about 1% in early trading on the news of the offering, despite the fact that it will dilute the value of current shareholders’ holdings. Tesla shares are up 85% so far this year, and up 337% since hitting a 52-week low early last June.