Federal District Judge Brian Morris of Montana has ruled the State Department must update its 2014 environmental impact study of the pipeline.
President Donald Trump approved the project in March last year, reversinig a denial by President Barack Obama.
The ruling could further delay the $8 billion project first proposed 10 years ago.
Nebraska regulators gave the green light for the project, but not along the “preferred” route proposed by TransCanada. The Public Service Commission, instead, authorized a route in November of last year which follows an existing TransCanada pipeline for about 90 miles.
Morris ruled the State Department has not adquately scrutinized the new route.
State Department reviews of Keystone XL have not found the pipeline would cause major environmental impact on the state.
The southern portion of Keystone XL is in operation from Oklahoma City to oil refineries along the Gulf Coast in Texas. TransCanada proposes building a 36-inch pipeline from Alberta, Canada to Steele City, Nebraska. It would carry crude oil made from the oil sands in western Canada.