OTTAWA/HOUSTON (Reuters) - U.S. energy firm Kinder Morgan’s C$4.5 billion sale of an oil pipeline to Canada’s government marked an extraordinary escape from months of fraught negotiations among warring camps of Canadian officials.

A workman walks past steel pipe to be used in the oil pipeline construction of Kinder Morgan Canada's Trans Mountain Expansion Project at a stockpile site in Kamloops, British Columbia, Canada May 29, 2018. REUTERS/Dennis Owen

But even before the bailout, the company had little to lose - despite the C$1.1 billion it has spent so far on a plan to add a second pipeline from Alberta’s oil sands to British Columbia’s coast, according to a Reuters review of the project’s bank financing and oil-shipping contracts with producers reserving space on the proposed line.

The documents show Kinder Morgan cut creative deals with lenders and oil producers to shield itself from massive write-downs like the ones taken recently by rivals TransCanada Corp and Enbridge Inc in canceling controversial pipeline projects.

The arrangements, which have not been previously reported, gave Kinder Morgan unique leverage in threatening last month to walk away from the project by May 31 unless Prime Minister Justin Trudeau’s government guaranteed a path to construction over the objections of British Columbia officials, environmentalists and some aboriginal bands.

The company’s cautious financial planning and hard-ball politicking combined to create a no-lose bet on what might have been one of the oil industry’s riskiest plays, given the volatility of Canadian pipeline politics.

The firm’s ultimatum made rescuing its Trans Mountain pipeline expansion a national emergency for Trudeau, thrusting the prime minister into a constitutional crisis over the limits of federal power and a political crisis in refereeing a feud between Alberta and British Columbia.

Trudeau argued the project must go forward to alleviate a crude transportation bottleneck that costs Canadian oil producers C$15 billion annually in forgone export revenue. The expansion would nearly triple the flow of crude through Trans Mountain pipelines, to 890,000 barrels per day.

Now, in a deal announced Tuesday, Canada will pay Kinder Morgan the C$1.1 billion it has spent and another C$3.4 billion for the existing pipeline and to compensate the firm for giving up the expansion’s potential profits.

“Kinder Morgan wins,” said Brian Kessens, managing director at Leawood, Kansas-based investment firm Tortoise, which holds shares in Kinder Morgan Inc. “That’s a very fair price.”

The rising costs of the pipeline expansion, he said, had cut its profit potential to “just a little north of their cost of capital.”

The firm’s Chief Executive Steve Kean celebrated its exit from the troubled project.

“This is a great day, not only for our company but for Canada,” he said.

Canadian Finance Minister Bill Morneau said the government took the drastic step to resolve an “exceptional” problem, calling the deal “the best way to protect thousands of good, well-paying jobs while delivering a solid return on investment for Canadians.”

Kinder Morgan’s leverage in the deal stemmed in part from careful risk management in earlier negotiations with the 13 oil producers who reserved capacity in the proposed line. The shippers agreed to cover about 80 percent of Kinder Morgan’s capital costs – even if the second pipeline never gets built, the contracts show.

The shippers promised to pay those costs over time through tolls on shipments through the existing pipeline, and the contracts included an “early termination” clause to ensure the producers paid even if regulatory problems blocked the project.

Slideshow ( 2 images )

The firm also negotiated with 26 lenders led by Royal Bank of Canada and TD Bank for a clause exempting the firm from paying a 2 percent penalty on funds drawn from up to C$5 billion in construction loans if it halted the project because of political problems, the documents show.

Another roughly C$220 million in financing, CEO Kean told analysts last month, came from assessments on oil producers shipping through Kinder Morgan’s Westridge export terminal in Burnaby, British Columbia, which is targeted for expansion to accommodate the second pipeline.

Twelve of the 13 oil producers - including BP Canada, Teck Energy Sales, Andeavor and Canadian Natural Resources - did not respond to Reuters inquiries or declined to comment on their contracts with Kinder Morgan. Canadian oil producer Cenovus Energy did not comment directly on the contracts but issued a statement saying Canada’s oil industry would continue to suffer from low prices and exports without new pipelines.

PLAYING A STRONG HAND

Kinder Morgan’s threat to abandon the project forced Trudeau to back up his assertion that the federal government had the authority to approve the pipeline over a provincial effort to regulate it out of existence, said Bob Prasad, senior director at Allnorth, a Vancouver-based energy engineering and consulting firm that has worked on the project.

The ultimatum was a “genius move on Kinder Morgan’s part to move this project along - and put a date to it,” Prasad said.

In response, federal and Alberta officials scrambled to rescue the project, promising to indemnify Kinder Morgan against further cost overruns from political roadblocks in British Columbia. Alberta officials went so far as to threaten cutting off oil supplies to British Columbia in retaliation.

At the same time, inside Kinder Morgan, one of the primary architects of its political and financial strategy, 43-year-old Dax Sanders, got a battlefield promotion last month - just as the pipeline’s construction prospects never looked more bleak. Sanders, finance chief of Kinder Morgan Canada Ltd, now also serves as head of overall strategy for the Houston-based parent company, North America’s second-largest energy infrastructure firm.

Sanders was unavailable for an interview Tuesday, a company spokesman said.

Robyn Allen - a vocal pipeline opponent and retired chief executive of an auto insurance firm - has long predicted the expansion would end in a government bailout. She opposed it specifically for that reason, unlike most other opponents who have cited fear of oil spills.

The Trudeau administration, she said, is paying C$4.5 billion “for a pipeline that is more than 65 years old” and assuming expansion costs she estimated could run as much as C$12 billion - far more than the firm’s latest estimate of C$7.4 billion.

By using assets of the existing Trans Mountain pipeline to finance its expansion, Kinder Morgan made the two inseparable in the bailout, Allen said.

“Now Kinder Morgan’s U.S. shareholders will be made whole,” she said. “They have offloaded all of these costs onto Prime Minister Justin Trudeau.”

Finance Minister Morneau declined to comment in a morning news conference on the costs to complete the project.

Finance Ministry spokesman Dan Lauzon, asked later on Tuesday about Allen’s C$12 billion estimate, said the government’s pipeline purchase was “commercially viable and has the potential to add value” for new investors.

TROUBLE AHEAD

Buying the pipeline hardly solves Trudeau’s political problems. It merely buys him time, at the cost of a massive investment of taxpayer money into the nation’s dicey oil transportation industry.

The government hopes to quickly resell the project to energy firms, a task made much harder by its tortured political history.

Though Trudeau asserts federal authority to approve the project, British Columbia officials could effectively bog it down for years in environmental studies, lawsuits and regulations that undercut its profit potential.

Trudeau could theoretically nullify any provincial law that effectively kills a federally approved project under a constitutional provision that hasn’t been used since the 1940s. But that’s unlikely given that his Liberal party relies far more on electoral support from British Columbia than from conservative Alberta.

The prime minister is already paying the political price.

“Those of us who knocked on doors for him will not forget that he took billions of dollars from Canadian families to buy out an oil pipeline,” said Tzeporah Berman, deputy director of Stand.earth, an environmental advocacy organization with offices in Vancouver.

The flack is flying from opponents on the right, too, including from Conservative Leader Andrew Scheer, head of the largest opposition party.

Trudeau’s pipeline deal, Scheer said, does nothing to solidify federal authority or settle constitutional questions.

“All he has done is force Canadian taxpayers to pay for his failure,” Scheer said. “He is trying to buy his way out of a problem.”