It was only last week that Tesla announced its first-ever quarterly profit, but the electric-car maker isn't waiting to repay its loan from the U.S. government.

Tesla (TSLA) announced Wednesday that it plans to sell 2.7 million new shares and raise $450 million in a bond sale. The proceeds, Tesla said, will be used to prepay the company's $465 million loan from the Department of Energy, with the remainder used in other aspects of its business.

Go inside the Tesla Model S and see what makes this car different.

In addition, Tesla's flamboyant CEO, Elon Musk, intends to buy $100 million worth of new stock in the company. Musk has already invested tens of millions of dollars in Tesla and has personally backed its resale-guarantee program.

All told, Tesla said it expects the actions to raise roughly $830 million.

Related: Tesla - The anti-Solyndra

News of secondary offerings typically sends a stock's value downward, as existing investors fear a dilution of their holdings. Not so with Tesla -- Musk's vote of confidence in the company pushed shares up 6% in after-hours trading Wednesday.

With the offering, Tesla appears set to avoid becoming a high-profile loss in the Department of Energy's loan program for clean-tech companies.

The most notable of these is solar-panel maker Solyndra, which filed for bankruptcy in 2011 after receiving a $527 million loan guarantee from the government. Electric-car maker Fisker, a Tesla competitor, recently missed the first payment on its $192 million government loan and appears on the brink of bankruptcy as well.

Tesla, meanwhile, has been riding high, its stock up 150% so far this year. The company blew past analyst expectations for first-quarter earnings and revenue earlier this month, reporting better-than-expected sales of its all-electric luxury car, the Model S.

Consumer Reports said last week that the Model S -- which sells starting around $70,000 -- was the best car it had ever tested.