Former Children's Secretary Ed Balls should pay compensation to ex-Haringey Children's boss Sharon Shoesmith following the death of Baby P, according to the Appeal Court judges.
Most of the pay-off will come from her legal employers Haringey Council and could top £1m.
She could be entitled to payments covering her back-dated salary, loss of future earnings and her pension.
But in their judgement the Appeal Court judges suggest the former Children's Secretary Ed Balls should also be asked to contribute.
"Although compensation is a matter between Ms Shoesmith and Haringey, it would be entirely appropriate for Haringey to seek a voluntary contribution from the Secretary of State whose unlawful directions gave rise to the problems", it says.
Baby Peter Connelly, who had been seen 60 times by the authorities, was found dead in 2007 with more than 50 injuries.
Ms Shoesmith's appeal was challenging a High Court ruling that cleared Ed Balls, the north London borough of Haringey and watchdog Ofsted, of acting unlawfully.
Ms Shoesmith told BBC London that she was left financially ruined by Mr Ball's treatment of her, but she had brought her case "for justice not money".
She was unlawfully sacked without prior warning and without knowing the contents of an Ofsted report on which Ed Balls claimed he was relying.
The judges said they were encouraging Haringey and Ms Shoesmith's lawyers to seek agreement or mediation, although further legal hearings will be necessary to decide the scope of her compensation and damages.
However the Department for Education and Haringey Council have both said they are seeking permission to appeal to the Supreme Court to try to overturn Friday's Appeal Court ruling.
The Appeal Court judge said of Ms Shoesmith: "Whatever her shortcomings may have been - and I repeat, I cannot say - she was entitled to be treated lawfully and fairly and not simply and summarily scape-goated.
"I find it a deeply unattractive proposition that the mere juxtaposition of a state of affairs and a person who is 'accountable' should mean that there is nothing that person might say which could conceivably explain, excuse or mitigate her predicament.
"Accountability is not synonymous with 'heads must roll'."
The judgement continued: "I do not consider it likely that Parliament when creating the position of Director of Children's Services intended those who may be attracted to such an important and difficult position to be volunteering for such unfairness in their personal position.
"Whilst I accept there was a degree of urgency, I do not accept that it was such as to necessitate atruncation of the requirements of friarness to the extent that occurred here.
'No urgency requirement'
"The question one has to ask is how much delay would have been occasioned by according Ms Shoesmith an opportunity to answer the charge."
It concluded: "This is not a case of a front-line social worker who may cause damage to individual children.
"It is one of a Director of Children's Services, more than a year after the death of Peter, in circumstances where, one way or another, the position could have been safeguarded for sufficient time for fairness to be observed.
"There was no requirement for particularly urgent action on the part of Haringey.
"They obviously wanted to get things sorted out, but Ms Shoesmith was not a front-line social worker, there was no particular need for her to leave forthwith, she was already suspended."