Elon Musk's hot streak continues.

Musk's Tesla Motors (TSLA) reported a surprise second-quarter profit on Wednesday, blowing past estimates on sales. The electric car maker reported earnings of 20 cents a share, excluding special items, after analysts predicted a loss of 17 cents. The stock surged 13% in premarket trading Thursday.

The company attributed its strong performance to record deliveries of its Model S plug-in sedan and improved margins.

Tesla is still expanding aggressively and said turning a profit at this point is "not our primary mission." Net income nonetheless increased 70% versus the previous quarter, with 5,150 Model S's delivered to customers.

The company improved production in the second quarter from 400 to almost 500 vehicles per week, and said further production gains are its "primary focus" going forward.

"The increasing rate of production and margin are even more compelling than the overall revenue and profit numbers," Kelley Blue Book senior analyst Karl Brauer said. "Tesla has clearly found an unmet market niche that's capable of supporting the company, at least in the near term."

Tesla said it plans to open "several more" dealerships this year, including its first in China. The company began deliveries to Europe this week, and said that if the demonstrated demand there and in North America is matched in Asia, the annualized Model S sales rate could surpass 40,000 by late 2014.

The Model S, for which prices start at $70,000, is currently the only car Tesla sells. The company is now developing an SUV known as the Model X that will begin delivery in late 2014, Musk told analysts Wednesday, with production ramping up in 2015.

The Model S has so far received wide acclaim, winning "Car of the Year" honors in 2012 from both Motor Trend and Automobile Magazine. Consumer Reports called it the best car it had ever tested.

Related: GM forms committee to study Tesla

Tesla shares, meanwhile, have been on a tear. After starting the year around $35, they closed at $134.23 on Wednesday, and pushed past $150 in premarket trading Thursday.

The company booked its first-ever quarterly profit in the first quarter of 2013, and has been in the headlines for much of this year.

In May, Tesla announced plans to expand its network of "supercharging" stations, aiming to have more than 100 locations across the country by the end of this year. The following month, Tesla unveiled a system that allows drivers to swap out Model S batteries in about 90 seconds.

Musk, Tesla's billionaire CEO, also co-founded online payment system PayPal and heads the commercial space travel firm SpaceX.

On Monday, Musk plans to publish his design for a futuristic transport system called the Hyperloop, which he has said could be three or four times faster than a bullet train and immune to crashes and bad weather.

Musk told analysts Wednesday that he will "invite critical feedback and see if people can find ways to improve" his Hyperloop design, adding that he has no immediate plans to develop the project.

"I have to focus on core Tesla business and SpaceX business, and that's more than enough," he said.