Tesla Motors Inc. shares surged near record highs after Deutsche Bank upgraded the electric-car marker, citing stronger-than-expected growth prospects over the next few years.

The stock jumped more than 5% to as high as $263.74, the highest level in more than five months. Shares are up 75% this year and sit just below the all-time high of $265 set in February.

Deutsche Bank analyst Rod Lache cited “a number of disclosures” from Tesla management on the company’s second-quarter earnings last month, which could be viewed as “very significant” for both Tesla and the auto industry overall.

“Tesla suggested that their growth trajectory will be much steeper, their mix will be much richer, and their costs will ultimately be much lower than we previously assumed,” Mr. Lache wrote in a note to clients. He boosted his rating to buy from hold and lifted his price target to $310 from $220.

Mr. Lache predicts Tesla will sell 60,000 vehicles next year on a global basis, 100,000 in 2016 and 129,000 in 2017, up from previous targets of 51,000, 60,000 and 83,000, respectively.

“At this point we see an increasingly clear path to 500,000 units of annual production by late this decade,” Mr. Lache said. “And we don’t expect growth to end there, as Tesla is already contemplating opportunities for additional production capacity.”

It also reached an agreement with Panasonic Corp. over the proposed construction and operation of a U.S. battery factory known as the Gigafactory.

The stock’s rally has been sharp over the past year and a half. In early 2013, shares traded in the low $30s before rallying in nearly unabated fashion to $193 by Oct. 1. The stock slumped over the next two months before climbing again to record highs in February. Shares have bounced around since.