Tesla reported first-quarter earnings excluding items of $15 million, or 12 cents a share, after posting a loss of 76 cents per share a year earlier, as it exceeded targets for deliveries and boosted profitability. Including non-cash warrant and stock option items, the company earned $15 million.

Tesla's 'Electric' Earnings Beat

CNBC's Phil LeBeau reports on Tesla's big earnings beat, which had shares of the company up 14 percent in after-hours trading.

Revenue jumped to $562 million from just $30 million a year ago.

Analysts had expected the company to report a profit of 4 cents on $500 million in revenue, according to a consensus estimate from Thomson Reuters.

Total gross margin rose to 17 percent from 8 percent in the fourth quarter as a result of a higher Model S production rate, manufacturing efficiencies, part-cost reductions and regulatory credit sales. Tesla said that while there was more work to be done to improve the Tesla Model S gross margin "we have a clear roadmap to achieve component cost reductions, as well as achieve additional manufacturing and logistics efficiencies."

Tesla expects its second-quarter gross margin to be in the high teens.

In terms of deliveries, Tesla expects to exceed its prior target of 20,000 worldwide deliveries for the year and raised guidance to about 21,000 deliveries. That figure is 9,000 less than what the company sees as likely global demand for the year.