A man serving life for the murders of three generations of the same family has had his convictions from 2002 quashed by the appeal court in Cardiff.
David Morris's lawyers have claimed he did not have a fair trial
David Morris, from Swansea, was serving life for beating to death Mandy Power, her two young daughters and her mother at Clydach, near Swansea in 1999.
Judges said he had not had a fair trial because of a conflict of interest involving one of his legal team.
A retrial was ordered and Mr Morris, 42, was remanded in custody.
Reading out the ruling in court on Tuesday, Lord Justice Pill said the argument, claiming Morris had not got a fair trial because of a conflict of interest involving his legal representatives, had succeeded.
At the original trial, Swansea Crown Court was told how Mandy Power, her daughters Katie, 10, and Emily, eight, and her 80-year-old disabled mother, Doris Dawson, were battered to death at their home in Clydach.
Firefighters discovered the bludgeoned bodies after they were called to put out a fire at the house, started by the killer to cover their tracks.
Mandy Power and her daughters were killed at the family home
All four had been attacked with an iron bar - Ms Power was hit 38 times, the trial was told.
Mrs Dawson was murdered as she lay in bed, while one of the children's bodies was found on the landing. Another was still in their bedroom, in a cowering position.
A former lover of Mandy Power, Mr Morris, a builder and scrap dealer, has always maintained his innocence and appealed against the convictions.
During hearings in Cardiff last February and April, the judges heard arguments from his new barrister, Michael Mansfield QC.
They centred around the fact that Morris' solicitor in the case, David Hutchison, also represented one of the original prime suspects in the case - police officer Stephen Lewis, who was originally suspected of the murders, along with his wife Alison Lewis.
Mrs Lewis, a former policewoman, was also the lesbian lover of murder victim Mandy Power. Neither was ever charged over the murders.
Relatives of the victims and David Morris were in court
Mr Mansfield argued that the solicitor's connection affected the fairness of his trial and, therefore, the safety of the convictions.
The suggestion was emphatically denied by Mr Hutchison.
Peter Rouch QC, who represented Morris during his trial, also denied there was a conflict on interest and had made all evidence available to the jury.
Also giving evidence during the appeal, Patrick Harrington QC, who prosecuted at the original trial, said Morris' convictions were safe.
"(The jury) had the advantage of a comprehensive and utterly fair summing up and they were given every assistance in defence counsel's speech," he said
The house was set on fire after the four murders
"These are solid and sound convictions, returned by a jury who had heard all the evidence they needed to reach their conclusions," he told the appeal court.
Speaking after the decision, Mandy Power's sister, Sandra Jones, called the defence solicitor's behaviour "at best irresponsible".
"If it wasn't for him, we would not be here today," she said.
"We have every confidence in the police case and in the way it was prosecuted, and that it will be presented equally as strongly the next time around."
South Wales Police Deputy Chief Constable Paul Wood said their thoughts were with Mandy Power's friends and family. "(They) must come to terms with today's decision and face the further ordeal of another trial," he added.
"South Wales Police will continue to support them throughout the case preparation and forthcoming trial."
Meanwhile Morris's sister Debra said: "We are pleased at the outcome today but this is not something that we should be going through anyway because my brother is innocent".