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 Stock Price Chart