Tesla delivered more electric cars in the second quarter than any three-month period in its history, alleviating concerns that demand is waning for its stylish vehicles as tax incentives in its main U.S. market begin to phase out.

Despite the heartening news Tuesday, Tesla still hasn't proven it can consistently make money despite repeated promises from CEO Elon Musk to reverse the company's long history of losses. And Tesla still must pick up its pace of deliveries during the final half of the year to hit the ambitions target set by Musk.

The company said it handed over 95,200 vehicles to customers worldwide from April through June, breaking its previous quarterly record of 90,700 set during the final three months of last year.

After finishing last year with a flourish, Tesla's sales engine sputtered to start this year. It had only 63,000 deliveries of its Model S, X and 3 vehicles during the first quarter, a 31% drop from last year's fourth quarter that alarmed investors. That slowdown, coupled with ongoing losses that have raised worries about Tesla's financial health , is the main reason that Tesla's stock had plunged by more than 30% so far this year.

The second-quarter delivery numbers triggered a relief rally, causing Tesla's stock to surge nearly 7% to $239.77 in Tuesday's extended trading.

Tesla will now have to prove it can maintain the second quarter momentum and turn a profit, too. The Palo Alto, California, company is aiming to deliver 360,000 to 400,000 vehicles for the full year. Just to hit the low end of that target, it will have to deliver more than 200,000 cars in the final half of the year.

That could be difficult, given Tesla buyers will be getting smaller tax credits than they had been previously. The U.S. tax credit for electric cars stood at $7,500, and then got cut half during the first half of this year. It is now shrinking again, to $1,875 through the rest of this year, before being eliminated entirely next year.

Cowen analyst Jeffrey Osborne wrote in a note to investors Tesla's full-year delivery guidance "reflects an extremely optimistic" second half. The third quarter, he wrote, will give a real picture of how steady demand is for the company's top-selling Model 3, which starts at $35,000.

He also questions Tesla's ability to post sustained profits. "We continue to see risks with the company's growth story, which we believe is likely to be challenged as competition enters the market," he wrote. "Simply, we see a lot more that can go wrong than can go right."

Musk himself has already acknowledged Tesla will post a loss for the past quarter, but forecast profits after that -- something he also did last year, only to be proven wrong. Analysts polled by FactSet are predicting the company will absorb a loss of about $228 million for the second quarter. If those projections hold true, Tesla will have lost nearly $1 billion during the first half of this year.

Tesla is expected to release its results for that period late this month or early next month.

Morgan Stanley analyst Adam Jonas wrote in a note that his investor clients see a large "air pocket" of sales to the start of the third quarter "setting up for a rerun of concerns around demand and cash flow."

Tesla so far has been able to stay afloat by borrowing heavily, something it did again earlier this year when it raised more than $2 billion to help pay its bills.

------

Associated Press Business Writer Cathy Bussewitz in New York contributed to this report.