(New throughout, adds comments from Canadian, Saskatchewan governments)
Nov 9 (Reuters) - A U.S. judge in Montana has halted construction of the Keystone XL pipeline designed to carry heavy crude oil from Canada to the United States, drawing a sharp rebuke on Friday from President Donald Trump.
The ruling of a U.S. Court in Montana late on Thursday dealt a major setback to TransCanada Corp, whose stock dropped 2 percent in Toronto. Shares of companies that would ship oil on the pipeline also fell.
TransCanada said in a statement it remains committed to building the $8 billion, 1,180 mile (1,900 km) pipeline, but it has also said it is seeking other investors and has not taken a final investment decision.
The ruling drew an angry response from Trump, who approved the pipeline shortly after taking office. It also piles pressure on Canadian Prime Minister Justin Trudeau to assist the country's ailing oil sector.
U.S. District Court Judge Brian Morris wrote that a U.S. State Department environmental analysis of Keystone XL "fell short of a 'hard look"' at the cumulative effects of greenhouse gas emissions and the impact on Native American land resources.
"It was a political decision made by a judge. I think it's a disgrace," Trump told reporters at the White House.
The ruling was a win for environmental groups who sued the U.S. government in 2017 after Trump announced a presidential permit for the project. Tribal groups and ranchers also have spent more than a decade fighting the planned pipeline.
"The Trump administration tried to force this dirty pipeline project on the American people, but they can't ignore the threats it would pose to our clean water, our climate, and our communities," said the Sierra Club.
The U.S. State Department, which could appeal the ruling, could not be reached for comment.
The pipeline would carry heavy crude from Alberta to Steele City, Nebraska, where it would connect to refineries in the U.S. Midwest and Gulf Coast, as well as Gulf export terminals.
Shares of Canadian oil producers Canadian Natural Resources Ltd and Cenovus Energy shed 3 percent.
Canada is the primary source of imported U.S. oil, but congested pipelines in Alberta, where the tar-like bitumen is extracted, have forced oil shippers to use costlier rail and trucks.
Several pipeline projects have been scrapped due to opposition, and the Trans Mountain line project still faces delays even after the Canadian government purchased it this year to move it forward.
"You have to wonder how long investors will tolerate the delays and whether the Canadian government will intervene again to protect the industry," said Morningstar analyst Sandy Fielden.
Canada, which has been trying to advance economic and environmental priorities at the same time, finds the ruling disappointing, said Vanessa Adams, a spokeswoman for Canada's Natural Resources Minister Amarjeet Sohi.
Ensuring at least one pipeline is built is critical to Trudeau's plans, with a Canadian election expected next autumn.
Alberta has felt the financial pressure, and an industry source said the provincial government last month solicited proposals from companies on ways to move crude faster by rail. The source said proposals included ideas such as buying rail cars and investing in loading terminals.
Ive never seen (the Alberta government) so active on this front, said the source, who asked not to be identified because the matter is politically sensitive. That is a shift.
The Alberta government did not comment. In a statement to Reuters on Thursday, a spokesman for its energy ministry declined to specify options under consideration.
"People have placed quite a lot of hope in that (Keystone) project, so it's a major setback," Saskatchewan Energy Minister Bronwyn Eyre said in an interview. Her province stands to lose C$500 million in annual royalties if the discount for Canadian crude remains steep, she said.
Morris, in his ruling, ordered the government to issue a more thorough environmental analysis before the project can move forward. He also said the analysis failed to fully review the effects of the current oil price on the pipeline's viability and did not fully model potential oil spills and offer mitigations measures.
The ruling likely sets Keystone back by up to one year, said Dan Ripp, president of Bradley Woods Research.
Former U.S. President Barack Obama rejected Keystone XL in 2015 on environmental concerns. (Reporting by Rod Nickel in Winnipeg, David Gaffen in New York and Brendan O'Brien; Additional reporting by Roberta Rampton in Washington, Julie Gordon in Vancouver and David Ljunggren in Ottawa; Editing by Jeffrey Benkoe and David Gregorio)