Ms Shoesmith claims her dismissal left her financially ruined
Children's Secretary Ed Balls has denied claims he acted unjustly in dismissing a children's services boss following the death of Baby Peter.
The High Court heard he ordered the removal of Sharon Shoesmith from Haringey Council to restore confidence in the child protection system.
A judicial review is looking into Ms Shoesmith's claims that she was removed from her post unlawfully.
Peter Connolly died at the hands of his family in August 2007, aged 17 months.
His mother Tracey Connolly, 28, her partner Steven Barker, 33, and Barker's brother Jason Owen, 37, were all jailed for their part in Peter's death.
Mr Balls' submissions before Mr Justice Foskett asserted that Parliament had given the secretary of state "broad" powers to intervene when he judged local child protection arrangements inadequate.
'Ended her career'
In the case of Baby Peter, he said he had not been "improperly motivated" by party politics or attempting to assuage vociferous elements of the media.
He said he acted following a "damning" joint area review carried out, at his request, by the Chief Inspector of Education, Children's Services and Skills; the Commission for Healthcare Audit and Inspection and HM Chief Inspector of Constabulary.
Baby Peter died from abuse despite 60 visits from authorities
The court earlier heard Ms Shoesmith has been left financially ruined and suicidal following her dismissal.
Her barrister James Maurici said she was a victim of a "flagrant breach of the rules of natural justice".
He argued that it was "unlawful" for Ofsted to publish its report on Haringey without giving Ms Shoesmith the opportunity to correct or contradict its findings.
Mr Maurici told the judge that Mr Balls made a televised press statement in which he announced that he had "summarily decided to remove" her from office in response to the inspectors' findings.
"That decision effectively ended, we say, the claimant's employment with Haringey. Indeed, we say it ended her career," Mr Maurici said.
Ms Shoesmith did not see the report until it was published on Ofsted's website after Mr Balls had already removed her from office, the court heard.
The case is expected to last three days.