Amnesty International has accused the Pakistani military of carrying out widespread human rights abuses in the country's northwest tribal region, where the army is fighting domestic Taliban fighters.
The UK-based human rights group also criticised the Taliban for a range of rights abuses, including the killing of captured soldiers and innocent civilians.
In the report, entitled The Hands of Cruelty, Amnesty said the military had regularly held people without charges and tortured, or otherwise mistreated them, in custody.
"Far from bringing respect for the rule of law, it is clear that current armed forces practices, and the legal and administrative system applied in the Tribal Areas, foster a climate of total impunity for human rights violations," the group said.
"Men and boys allegedly arrested and detained by the armed forces are being returned dead to their families or reportedly found dumped across the Tribal Areas almost every week.
"Detainees who are released alive and their families are threatened with dire consequences if they speak publicly about their treatment in detention."
In a statement sent to the media, the military rejected the allegations, calling Thursday's report "a pack of lies" and part of a "sinister propaganda campaign against Pakistan and its armed forces".
The army and the Taliban have been engaged in a bloody fight in the northwest for the past several years.
The fighters have carried out scores of attacks around the country that have left thousands of people dead.
Amnesty acknowledged the challenge that Pakistan is facing in fighting the Taliban along its border with Afghanistan.
But it criticised the government and the military for failing to investigate the alleged abuses.
It also said a combination of new security laws and colonial-era regulations often provided the military a legal cover for abuse.
The rights group said it was unaware of any serving or retired member of the military, law enforcement authorities or intelligence services being prosecuted for alleged involvement in unlawful detentions, torture or other ill-treatment.
"Without urgent action by the Pakistan government to guarantee respect for human rights in the Tribal Areas, millions will continue to be locked in a perpetual state of lawlessness," said Amnesty.
The report was largely based on more than 100 testimonies from victims of human rights violations in detention, witnesses, relatives, lawyers, Pakistani officials and fighters.