Shares of Tesla Inc. closed 16% higher on Thursday as Wall Street appeared to seize on the Silicon Valley car maker’s renewed promises of profitability and on Chief Executive Elon Musk’s apologies.

The stock ended at $349.54, its highest close since June 28, and notched its largest one-day percentage gain since December 2013. It was the best performer on the Nasdaq 100 on Thursday.

It ended flat on Friday, bringing weekly gains to 17%, its largest weekly gain since mid May 2013.

Tesla TSLA, +1.95% late Wednesday reported a loss of $718 million, or $4.22, in the second quarter, compared with a loss of $336 million, or $2.04 a share, in the year-ago period.

Read more:Live Blog: Tesla earnings send stock higher

Adjusted for one-time items, Tesla lost $520 million, or $3.06 a share, compared with $220 million, or $1.33 a share, a year ago. Revenue rose to $4 billion from $2.77 billion a year ago.

Analysts polled by FactSet had expected adjusted losses of $2.88 a share on sales of $3.99 billion.

Helping to assuage recent concerns about Tesla, Musk sounded more subdued on the conference call following the results, apologizing directly to each of the two analysts who were cut off in the May conference call, and taking a few questions from reporters.

Tesla’s first-quarter conference call in May is etched in Wall Street’s memory as the one where Musk’s own performance overshadowed discussions about the company, and words such as “boneheaded” entered the lexicon of the usually highly orchestrated post-results call.

At that May event, the CEO interrupted analysts as well as members of his executive team, pivoted to answer numerous questions from a man who runs a YouTube channel mostly dedicated to Tesla, and blamed the press for what he believed to be slanted coverage of autonomous-driving car crashes.

See also:Tesla analysts call out Elon Musk after ‘truly bizarre’ conference call

Musk struck a very different tone Wednesday, seeking to assure shareholders that Tesla was on track with Model 3 production goals, that demand for the mass-market sedan was healthy and that the company does not need nor anticipates tapping capital markets in the near future.

Musk and other executives also reiterated that the company will be profitable and cash-flow positive in the second half of the year.

Read more:Tesla reveals new chips for self-driving cars

In a letter to shareholders before the call, Tesla said it aims to produce 6,000 Model 3 sedans a week by late August, and also kept intact its target of delivering 100,000 Model S and Model X vehicles this year. Shares ended the regular trading day up 0.9%.

The car maker said it expects to produce 50,000 to 55,000 Model 3 sedans in the third quarter, and vowed to grow the car’s gross margins to 15% in the third quarter and to 20% in the fourth quarter. Capital expenditures will stay below $2.5 billion for the year, compared with $3.4 billion in 2017.

Even by Tesla’s standards, the quarterly report was a closely followed one, coming on the heels of a series of controversies surrounding Musk that have led some investors to question his leadership.

Most recently, hedge fund Greenlight Capital lashed out at Tesla in a letter to investors that became quite personal, saying that Musk “appears erratic and desperate.”

Greenlight founder David Einhorn was said to be “happy” his lease on a Model S had expired and planned to switch to an electric Jaguar.

Tesla’s Wednesday results brought earnings season to a close for major U.S. auto makers.

Related:GM stock at lowest level since May after earnings, lowered profit outlook

General Motors Co GM, -0.78% and Ford Motor Co. F, +0.30% reported their second-quarter results last week, with both badly missing Wall Street expectations and mostly blaming their miss on rising raw-material prices and tariffs.

See also:Ford keeps investors in the dark, and shares pay the price