NEW YORK — Canada’s Enbridge is buying Houston-based Spectra Energy for about $28 billion, creating North America’s largest energy infrastructure company.

Both companies operate pipelines that deliver oil and natural gas.

Under the terms of the deal announced Tuesday, Spectra Energy shareholders will receive 0.984 a share of the combined company, or about $40.33 for each Spectra Energy share they own.

When the deal closes, which is expected to happen in the in the first quarter of 2017, Enbridge shareholders will own about 57 percent of the combined company and Spectra Energy shareholders will own about 43 percent.

The combined company will be called Enbridge Inc. and keep its current headquarters in Calgary, Canada.

Enbridge’s U.S. shares rose $2.66, or 6.5 percent, to $43.65 in afternoon trading Tuesday. Shares of Spectra Energy Corp. rose $5.43, or 15 percent, to $41.58.