OTTAWA - The federal Liberal government has no plans to drag Canada permanently into the pipeline business, Finance Minister Bill Morneau said Tuesday as he unveiled a $4.5-billion plan to buy the Trans Mountain pipeline and its various assets to ensure a planned expansion is able to proceed.

If Canada indeed ends up buying the pipeline, it will be solely to ensure its capacity can be tripled, allowing Canada to find new export markets for its oil resources, Morneau said - and that ultimately, the long-term goal will be to find a private-sector buyer to take it over.

“The Trans Mountain expansion project is of vital interest to Canada and to Canadians,” Morneau told a news conference in Ottawa.

“Our government's position is clear: it must be built, and it will be built.”

Morneau said the government's hand was forced by B.C. Premier John Horgan, who has gone to court for judicial approval to regulate what can flow through the pipeline - a measure of opposition that made Kinder Morgan Canada, the project's original owner, too nervous to continue.

The company halted all non-essential spending on the pipeline expansion in April pending reassurances from Ottawa that the project would come to fruition. Morneau had said Canada would cover any cost overruns caused by B.C.'s actions, but in the end, that clearly wasn't enough.

“We need to deal with the political uncertainty,” he said. “The only (way) in our estimation that that can be done is through exerting our jurisdiction by purchasing the project.”

Kinder Morgan agreed to start construction this summer as planned, and will work until July 22 trying to find another private-sector buyer. If none comes forward, only then will Kinder Morgan take Ottawa's $4.5-billion offer to its shareholders.

Pending their approval, the sale would be finalized sometime in August or September.

The purchase price includes most of Kinder Morgan Canada's core assets - the existing pipeline, the pumping stations and rights of way, and the Westridge marine terminal in Burnaby, B.C.

That terminal is where the diluted bitumen from the pipeline would be loaded onto tankers and shipped out to sea, with the ultimate goal being to sell Canadian oil in Asia.

The pipeline purchase would also transfer to the federal government all of the people involved in building the expansion, including project managers and construction workers. Canada would then proceed with construction, selling the pipeline when it would generate the best return.

There are parties interested in the pipeline, including Indigenous communities and pension funds, Morneau said, but his officials acknowledged it may be hard to find a buyer amid lingering uncertainty until after the pipeline is actually built.

If Canada takes on the project, Export Development Canada would finance it through a newly established Crown corporation - an approach officials say would help to defray B.C.'s threats of delay. Existing statutes stipulate one level of government cannot interfere with the work of another - a situation one official called a “conversation changer” that might convince Horgan to back down.

Were that court challenge to be dropped, it would remove a lot of the risk that has made the project so unattractive to the private sector.

Morneau stressed repeatedly the pipeline is commercially viable and profitable. Kinder Morgan makes about $200 million a year from selling space in the existing pipeline to oil companies to ship their product.

The $4.5-billion purchase price does not cover the construction costs of building the new pipeline, however; Morneau refused to say what that cost may be. Kinder Morgan last year said it was about $7.4 billion, plus about $1 billion already spent - an estimate that's now considered low.

The government has an estimate, but disclosing it would put the government at a disadvantage when it comes to finding a private-sector buyer, officials later clarified.

None of Tuesday's news appeared to do much to dissuade Horgan, however, who insisted his court challenge would proceed.

“The federal government has made a choice, a decision that was motivated by the decisions of a private company that gave a deadline, not to me, not to the people of British Columbia, but to someone they characterized as stakeholders,” Horgan said.

“The federal government has responded and that's their business.”

Horgan said his concerns remain rooted in what he calls the limited scientific knowledge of how diluted bitumen behaves in water, as well as perceived gaps in prevention efforts and response plans in the event of a spill.

Prime Minister Justin Trudeau called Horgan five minutes before Morneau made the plan public Tuesday morning. B.C. was given no advance notice of what was coming.

“It does not change the course that the Government of British Columbia has been on,” Horgan said.

Alberta Premier Rachel Notley, however, could barely contain her delight.

“As of today, this is the most certainty that this project has ever had,” she said. “That certainty is absolutely critical.”

Alberta has agreed to put up to $2 billion on the table to cover off any unexpected costs during the sale or construction phases, and will receive equity or profit for any money it does put in.

Environment groups, meanwhile, accused the federal Liberals of abandoning their environmental promises. Indigenous groups said their concerns are being ignored. And the Opposition Conservatives were livid at the prospect of nationalizing a private-sector asset.

“This is an extremely sad day for Canadian taxpayers,” Conservative Leader Andrew Scheer said during question period.

“The prime minister is forcing them to fix his failure on Canada's energy sector.”