Tesla Motors announced Wednesday that it has repaid a $465 million loan from the government nearly a decade before it was scheduled to do so.

The electric-car maker received the loan from the Department of Energy in January 2010, and it made its first payment this past December. That began what was supposed to be a 10-year repayment program, but plans have changed.

See what shat sets the Model S apart from other cars.

Tesla (TSLA) reported its first quarterly profit earlier this month, and Consumer Reports came out with a review calling the Tesla Model S the best car it ever tested. Those two facts, along with a significant short squeeze, helped send the stock soaring to record highs.

Related: Tesla's windfall from rival automakers

Tesla announced last week that it would sell additional shares of stock, and that founder Elon Musk would make a new $100 million investment as well. The company said it would use some of the proceeds to repay the loan this week.

"I would like to thank the Department of Energy and the members of Congress and their staffs that worked hard to create the [loan] program, and particularly the American taxpayer from whom these funds originate," Tesla co-founder and CEO Elon Musk said in a statement. "I hope we did you proud."

The early repayment ensures that Tesla won't join the loan program's list of high-profile failures.

Related: Tesla's fight with America's auto dealers

Solar-panel maker Solyndra, which received a $527 million loan guarantee, filed for bankruptcy in 2011. And rival electric-car maker Fisker, which had a $192 million loan, missed its first scheduled repayment earlier this year and has essentially halted business operations.

The Department of Energy said Wednesday that losses in the loan program so far represent only about 2% of a $34 billion portfolio, and less than 10% of the $10 billion loss reserve Congress set aside in advance. Secretary of Energy Ernest Moniz called Tesla "living proof of the power of American innovation."

"When you're talking about cutting-edge clean energy technologies, not every investment will succeed -- but today's repayment is the latest indication that the Energy Department's portfolio of more than 30 loans is delivering big results for the American economy while costing far less than anticipated," Moniz said in a statement.

CNNMoney's James O'Toole contributed reporting.