Three people were wrongly accused of downloading child abuse images due to a broadband wiring error by a BT engineer, a tribunal has heard.
The mistake meant internet activity linked to the real offender was traced instead to the address where two men and a woman were staying, who had their electronic devices seized over the course of two police searches.
The false accusations back in 2016 had "highly distressing and far-reaching" consequences for the three, the Investigatory Powers Tribunal (IPT) was told.
It ruled that Dyfed-Powys Police had acted lawfully, and found that the error was caused by a technical fault rather than police misconduct.
BT has been approached for comment.
The IPT deals with complaints from anyone who feels they have been the victim of unlawful action by a public body using covert investigative techniques.
Each of the three claimants were granted anonymity by the tribunal, and the location of the incident was only described as Dyfed-Powys Police's "area of operation in Wales", which covers Carmarthenshire, Ceredigion, Pembrokeshire and Powys.
British telecommunication firm BT told the tribunal that two wires within a street cabinet linking to both addresses had been inadvertently crossed.
As a result the offending IP address had been incorrectly attributed to the address of the the first male claimant who was its registered tenant, which he shared with a friend whose girlfriend was also visiting at the time.
The tribunal heard all three had to tell their employers about the accusations made against them.
The innocent woman was advised her children could not live with her alone until she was cleared, and the two men faced child protection referrals. The first male claimant was placed on restricted duties at work and the second had a job offer withdrawn.
The three were never charged, and police later identified and prosecuted the actual offender who lived nearby.
The tribunal did not find grounds for compensation or remedies for the three claimants, as the force had acted within the law and responded appropriately once the error was discovered.
A spokesperson from Dyfed-Powys Police said: "We recognise the upset and hurt suffered by the claimants in this case, and commend them for the dignity, integrity, and full co-operation shown throughout.
"We welcome the judgement which recognises that the errors discovered were no fault of the police, and all investigatory actions carried out by our officers were lawful, proportionate, and necessary.
"Despite the difficult circumstances, we are satisfied that the party responsible for this error has been brought to justice."