Image copyright AFP Image caption The Canadian prime minister has to balance energy and the economy

Canada will approve two major pipeline projects, but reject a third proposal, Prime Minister Justin Trudeau has announced.

Kinder Morgan Inc's Trans Mountain pipeline and Enbridge's Line 3 pipeline were given the green light by Ottawa.

But the federal government rejected a separate Enbridge project, the Alberta-to-British Columbia Northern Gateway.

Mr Trudeau's decision is a major test as he tries to balance his environmental and economic promises.

His announcement angered environmental groups and some First Nations.

It also comes as energy politics look set to undergo a shift in the US under president-elect Donald Trump.

Mr Trudeau said on Tuesday the approved projects are in the national interest and part of Canada's "clean energy transition".

"We are under no illusion the decision today will be bitterly disputed," he said.

The Canadian Chamber of Commerce applauded the decision, saying it will diversify Canada's energy markets and create jobs.

Environmental groups were quick to react, saying the decision raised doubts as to whether the country would be able to meet its international climate commitments.

Image copyright Getty Images Image caption Alberta's oil sands have long been a a target of climate change campaigners

The approved pipelines will be a boon to the Alberta oilpatch, which has struggled under prolonged low oil prices and in the wake of the Fort McMurray forest fires.

Canada is one of the world's largest energy producers.

The Trans Mountain Alberta-to-British Columbia project will twin an existing pipeline and increase its capacity from 300,000 barrels a day to 890,000 barrels a day.

Enbridge's Line 3 Alberta-to-Wisconsin pipeline will replace an existing aging pipeline currently running at half capacity. Once completed, it would carry up to 760,000 barrels of various crude oils per day.

Despite their approval by Ottawa, the projects will likely face protests and litigation.

Northern Gateway was a twin pipeline project from Alberta to northern British Columbia, where a marine terminal would have been built.

It had been in limbo since a federal court in June overturned an earlier National Energy Board approval. The ruling found Ottawa had not adequately consulted Indigenous people along the route.

Mr Trudeau also announced a moratorium on crude oil tankers on British Columbia's north coast.

In September, Indigenous nations from across North America signed a letter committing to oppose five pipelines, including Line 3, Northern Gateway, Trans Mountain and the Keystone XL.

Grand Chief Terry Nelson of the Winnipeg-based Southern Chiefs Organization told the BBC that opposition to many of these projects runs deep.

"People should not simply dismiss this as rhetoric," he said.

First Nations opposition to energy infrastructure projects is not unanimous, however. Numerous First Nations have signed on as equity partners to various proposed projects.

Image copyright Getty Images Image caption Mr Trump's advisor Kellyanne Conway will visit the oil sands in January

Mr Trudeau will also have to find a political calculus between his climate agenda and Mr Trump's.

Canada and the US often act in concert on climate initiatives. There are concerns that unilateral initiatives would give the US a leg up on jobs and investment.

Mr Trump's position on initiatives is very different from Mr Trudeau's. He has vowed withdraw from the Paris climate agreement and to revive the coal industry. He has also expressed interest in resuscitating TransCanada's Keystone XL Alberta-to-Texas pipeline project.

That is underscored by a planned visit to Fort McMurray by Kellyanne Conway, a senior advisor on US Pesident-elect Trump's transition team.

Ms Conway will be touring the oil sands and meeting Alberta businesspeople in January, shortly before the inauguration.

Earlier this year, Mr Trudeau announced Ottawa would implement a minimum nationwide carbon tax for 2018 and would phase out traditional coal-fired electricity by 2030.