WASHINGTON -- The contract assigning a third-party company to investigate the environmental impacts of the Keystone XL project adds to questions about the impartiality of the study, after the document was shown to be a binding contract between the outside company and the company building the pipeline, not the State Department.

The contract, posted quietly to a State Department website on Friday in response to a request by Sen. Bernie Sanders (I-Vt.), shows that it is a signed agreement between Entrix, an outside consultant, and TransCanada, the pipeline builder.

The posted version was also heavily excised, with most names and numbers, as well as some entire pages, blacked out.

"What appears to have happened was Entrix was doing an environmental study intending to minimize the potential environmental impacts of Keystone XL," said Anthony Swift, an energy lawyer with the Natural Resources Defense Council. "It's sadly not incredibly surprising. We were dealing with an environmental review that was done by Entrix on TransCanada's behalf, and that does not pass muster of environmental law."

The State Department has previously defended the arrangement as following typical third-party contracting procedures.

"Third-party contracting is very common in federal environmental reviews of projects proposed by private applicants," a State Department spokesman told HuffPost Friday. "In each case, the applicant, a private company, pays the cost of the review so that taxpayers do not have to, while the work of the contractor is entirely supervised by the federal agency."

Still, State has long refused to release the contract itself. Environmental advocacy groups and several senators have been seeking access to it ever since it was first reported in The New York Times that Entrix had pre-existing ties to TransCanada, and once described it in marketing materials as a "major client."

"This has arguably been the most tightly held document over Keystone," said Damon Moglen, the director of the climate and energy program at Friends of the Earth, which also obtained the documents under a long-delayed FOIA request. "You get this sense with this contract that Entrix was acting as an adjunct to TransCanada."

Entrix and TransCanada have denied conflict of interest allegations. The Huffington Post previously reported that the State Department's review of the environmental impact of Keystone XL was hampered by its lack of scientific staff equipped to mediate any disputes that might emerge between TransCanada and the contractor.

This story was updated to include comment from the State Department.