Parliament has reached an agreement in principle to view the uncensored Afghan detainee documents, but the deal could still unravel when MPs meet Friday.

Under the tentative agreement, one MP per party would be allowed to look at the documents, and an eminent panel of judges would decide which documents could be released, CTV Ottawa Bureau Chief Robert Fife reported Thursday night.

The stakes are high for MPs on all sides: If the deal falls apart on Friday, it could lead to a contempt of Parliament motion against the government.

That could spark an election, and even possible legal action against cabinet ministers.

On April 27, House Speaker Peter Milliken ruled that opposition MPs had a right to ask for the uncensored documents, but Parliament would need to "devise a means" whereby confidential information would still be protected.

"Surely that's not too much to hope for," he said.

The documents are believed to contain information related to the alleged torture of Afghan prisoners by local authorities, after they were transferred by Canadian soldiers.

Opposition members demanded the government hand over the documents last December. But the Conservatives refused, citing national security concerns and arguing that parliamentarians had no right to ask for them.

Instead, the Conservatives released heavily-censored versions of thousands of pages of detainee-related documents.