LINCOLN, Neb./WASHINGTON—Nebraska regulators voted on Nov. 20 to approve TransCanada Corp.’s Keystone XL pipeline route through the state, lifting the last big regulatory obstacle for the long-delayed project that U.S. President Donald Trump wants built.

The 3-2 decision by the Nebraska Public Service Commission helps clear the way for the proposed 1,179-mile pipeline linking Canada’s Alberta oil sands to U.S. refineries, but is likely to be challenged in court by the project’s opponents who say it poses an environmental risk.

Trump, a Republican, has made Keystone XL’s success a plank in his effort to boost the U.S. energy industry. Environmentalists, meanwhile, have made the project a symbol of their broader fight against fossil fuels and global warming.

The proposed line has been a lightning rod of controversy since it was first advocated nearly a decade ago. The administration of former President Barack Obama, a Democrat, considered the project for years before rejecting it in 2015 on environmental grounds.

Trump swiftly reversed that decision after coming into office this year, handing TransCanada a federal permit for the pipeline in March and arguing the project will lower fuel prices, boost national security, and bring jobs.

That decision placed the pipeline’s fate into the hands of the obscure regulatory body in Nebraska, the only state that had yet to approve the pipeline’s route.