Shareholders of Tesla Motors Inc. and SolarCity Corp. approved Tesla’s $2.1 billion all-stock offer to merge and create one company headed by Elon Musk that would sell emissions-free cars and rooftop solar panels that power them.

“Your faith will be rewarded,” Mr. Musk told Tesla investors on Thursday after the company announced shareholders overwhelmingly approved the deal.

Tesla...