NEW YORK (Reuters) - Investors have rushed back into North American pipelines after U.S. President Donald Trump revived growth prospects in a sector that struggled to cope with a two-year oil price slump and strident opposition from environmental and Native American activists.

Deer gather at a depot used to store pipes for Transcanada Corp's planned Keystone XL oil pipeline in Gascoyne, North Dakota, January 25, 2017. REUTERS/Terray Sylvester

Investor confidence in the industry was shaken last year when the administration of former President Barack Obama halted the $3.8 billion Dakota Access Pipeline, just as Energy Transfer Partners ETP.N had nearly finished building it. Protesters have rallied for months against plans to route the Dakota Access pipeline under a lake near the Standing Rock Sioux reservation in North Dakota, saying it threatened water resources and sacred Native American sites.

A year earlier, Obama rejected TransCanada Corp's TRP.TO C$8 billion ($6.08 billion) Keystone XL project, which would ship oil from Canada to U.S. refiners.

Trump sought to smooth the way for both projects with executive orders on Tuesday as he made good on campaign promises to drive infrastructure investment throughout the world’s largest economy.

The orders sparked a rally in indices that track pipeline companies to a more than 14-month high.

The shares of firms that build the pipelines and storage tanks such as Magellan Midstream Partners MMP.N and Enterprise Products Partners EPD.N have rallied as much as 9 percent in the days following Trump's orders.

Those gains came on top of a rally of about 13 percent in these firms since Trump’s surprise election victory on Nov. 8.

“Energy companies can invest more confidently over the next four years with less concern over federal delays,” said Libby Toudouze, a portfolio manager at Cushing Asset Management. The firm manages around $2.7 billion of investments in pipeline and energy transport and storage firms.

“I do think we are going to see a good consistent flow of new investors coming into this (pipeline) space for next 3-5 years.”

The top picks for investors include Valero Energy Partners LP VLP.N, Phillips 66 Partners LP PSXP.N and MPLX LP MPLX.N.

Energy infrastructure companies, once a darling of the industry, had languished in 2015 and early 2016 as oil prices plummeted to multiyear lows.

These firms, often structured as master limited partnerships (MLPs), are typically the vehicles used by investors to gain exposure to the pipeline industry.

MLPs are a tax-exempt corporate structures that pay out profit to investors in dividend-style distributions. Investors have funneled billions of dollars into the infrastructure industry through them since the shale boom began.

BLISTERING RALLY

The Alerian MLP index .AMZ, which tracks a number of pipeline firms including Magellan, Enterprise, Energy Transfer Partners and Plains All American Pipeline LP PAA.N, has risen more than 17 percent since Trump's election, including a 6 percent rally this week to the highest level since November 2015.

The pipeline sector has outperformed both oil and gas producers .SPLRCOILP and the S&P 500 index .SPX, which have risen about 13 percent and 7.5 percent, respectively, since the U.S. election.

“You don’t have to take a lot of risk in the MLP space at this point to make outsized returns ... so it’s an interesting time and a unique opportunity in the MLP space,” said Matt Sallee, a portfolio manager at Tortoise Capital.

The Alerian index rose 9 percent in 2016 as oil prices rose, OPEC and non-OPEC exporters announced supply cuts, and on Trump’s election. That came after a crash of more than a third in 2015.

Mutual and exchange traded funds’ investment in MLPs crashed to $3.8 billion in 2015 before recovering to about $6.2 billion last year, according to Morningstar.

The revival in U.S. shale activity sparked by the recovery in oil prices has also given pipeline companies a boost and opened the way to further development. Significant challenges remain - activists plan to take their fight to the courts on a state-by-state basis, which could bog down future developments.

But for now, investors see room for the value of pipeline firms to go higher.

“We think drilling is going to expand in the U.S. and will need plenty of new infrastructure, particularly in the Permian Basin,” said Jay Hatfield, portfolio manager of the InfraCap MLP ETF. MLPs were around 60 percent undervalued compared with BBB bonds which usually fetch the same yield, he added.

Already, pipeline companies such as Plains All American have announced large deals and expansions in the Permian, the biggest shale play in the United States.

“Production is getting back to the growth mode,” said Toudouze, “so we need to have the infrastructure and these are the companies that are going to build it.”