By Michael Dabaie

Shares of Nikola Corp. and General Motors Co. were up in morning trading after the companies said GM will take a stake in Nikola and engineer and manufacture Nikola's Badger electric pickup truck.

Under the deal, General Motors will receive 11% ownership of Nikola and the right to nominate one director. Nikola will exchange $2 billion in newly issued common stock for in-kind services and access to General Motors' parts and components.

GM will engineer, validate, homologate and build the Nikola Badger electric pickup truck for both the battery electric vehicle and fuel cell electric vehicle versions.

Nikola shares were up 37% to $48.72 in morning trading, while GM was up 9% to $32.58.

As part of the deal, the electric-truck startup will use GM's Ultium battery system and Hydrotec fuel-cell technology.

Nikola will be responsible for the sales and marketing for the Badger and will retain the Nikola Badger brand. The Badger will be unveiled in December, and production is expected to start in late 2022.

General Motors will be the exclusive supplier of fuel cells globally, outside of Europe, to Nikola for Class 7/8 trucks, the companies said.

Last month, Nikola said it secured an order for 2,500 electric garbage trucks from refuse giant Republic Services Inc.

Nikola said it anticipates saving more than $4 billion in battery and powertrain costs over 10 years and more than $1 billion in engineering and validation costs. GM said it expects to receive more than $4 billion of benefits between the equity value of the shares, contract manufacturing of the Badger, supply contracts for batteries and fuel cells, and EV credits retained over the life of the contract.

"This news is a huge shot in the arm for Nikola and cements credibility not just for its Badger production slated to begin by the end of 2022 but for its hydrogen fuel cell ambitions and semi truck vision going forward," Wedbush said in an analyst note.

"For GM given its strategic goal around EV battery technology for the coming years and its massive $20 billion of investments earmarked for electric and autonomous vehicles by 2025, we view this as a smart strategic bet at the right time," the Wedbush note said.

The firm maintained its Neutral rating on Nikola.

"By joining together, we get access to their validated parts for all of our programs, General Motors' Ultium battery technology and a multi-billion dollar fuel cell program ready for production. Nikola immediately gets decades of supplier and manufacturing knowledge, validated and tested production-ready EV propulsion, world-class engineering and investor confidence. Most importantly, General Motors has a vested interest to see Nikola succeed," said Nikola Founder and Executive Chairman Trevor Milton.

"This strategic partnership with Nikola, an industry leading disrupter, continues the broader deployment of General Motors' all-new Ultium battery and Hydrotec fuel cell systems," said General Motors Chief Executive Mary Barra. "We are growing our presence in multiple high-volume EV segments while building scale to lower battery and fuel cell costs and increase profitability."

Last year, Ford Motor Co. took a $500 million stake in electric-truck startup Rivian Automotive.

Write to Michael Dabaie at michael.dabaie@wsj.com