In a much-anticipated development, Tesla Motors said today that it had fully paid the government back for a $465 million loan it received in 2010 from the Department of Energy (DOE).

The company announced it had wired $451 million to the government, which accounted for the entire loan and interest. Tesla founder Elon Musk said earlier this spring at a DOE-sponsored conference that the company would be able to pay off the loan five years earlier than expected. Turns out, the loan was repaid nine years earlier.

The half-billion-dollar loan was used to build two manufacturing plants in California -- one for the Model S sedan and another for battery, motor and electrical equipment assembly. Accessing the loan meant that Tesla had to hit certain production milestones and raise private matching funds.

After meeting its targets, the loan was repaid through $1 billion raised in last week's stock offering.

Tesla became a negative target during the 2012 presidential election, when Mitt Romney called the company a "loser" during a debate. 

In a statement, Musk thanked the Energy Department, Congress and taxpayers for helping the company. “I hope we did you proud," he wrote.

Earlier this week, the 100,000th plug-in electric vehicle was sold in the U.S. -- a number far below expectations for EVs, but proof that the market is starting to accelerate.

Below is Eric Wesoff's article on Tesla's latest quarterly earnings:

Tesla shares surged 12 percent in after-hours trading on news that the company reached profitability in Q1 for the first time in its ten-year history, with a profit of $15 million on sales of $562 million for the quarter -- a record for the EV producer.

Tesla produced 400 or more Model S vehicles per week and a total of 5,000 units in the quarter, beating estimates. All sales, so far, are in North America.

Revenue for Q1 was $562 million at a 17 percent gross margin. Sales of zero-emission vehicle (ZEV) credits, as covered yesterday, accounted for $68 million, but will not be anticipated in the future nor expected for the company's Q4 guidance of 25 percent gross margin. (Note that Q1 margins would be in the 5 percent range absent the ZEV credits.)

Tesla raised its 2013 guidance to selling 21,000 electric vehicles (instead of 20,000) this year.  

According to reports, California provides Tesla with $35,000 in zero-emission vehicle credits, which Tesla sells to automakers. In addition, Tesla receives other state and federal monies.

Tesla expects operational expenses and R&D expenses to increase next quarter as more dealerships and service centers are built.

Barclays writes that the investment bank is "agnostic as to whether Tesla can break into the mass affluent Gen III market, and downright skeptical of its ability to become a true mass-market automaker," adding, "In addition, GAAP revenue and EPS will likely be faced with a headwind from GAAP accounting around the new loan product, which will lead to some revenues being deferred." 

In the meantime, Tesla is beating guidance and making money.

TSLA Chart

TSLA data by YCharts