The decision came as US President Barack Obama was set to meet with Canadian Prime Minister at a trade summit in Mexico.
Obama was expected to face a new entreaty from Harper to quickly make up his mind on the project, which would carry crude from Canada's oil sands across the continental United States to Texas.
District Court Judge Stephanie Stacey did not rule on the merits of the pipeline or the proposed route.
Instead, she issued a 50-page ruling that found the state legislature and governor were wrong to wrest control from the public service commission tasked with reviewing and approving oil pipelines.
She granted an injunction prohibiting the state from enforcing the law or taking any action on the governor's approval of the route.
Canada is deeply frustrated at delays in the project, which was first proposed in 2008 and is still awaiting a construction permit.
But Harper is unlikely to get an answer from Obama, as Secretary of State John Kerry continues his deliberations on the project.
The project has pitted environmental groups against the oil industry, which has argued that it will bring much-needed jobs to the United States and help fulfill the US goal of energy self-sufficiency.
A State Department report last month concluded that the pipeline would not significantly impact global warming, as Canada would extract the dirty tar sands oil even if it is not built, but stopped short of issuing a recommendation.
Construction has already begun on parts of the pipeline which do not require the federal government's approval.
Story originally reported on AFP.com