In a test ruling in the High Court in London, three judges opened the way for the immediate release of two prisoners, the freeing of up to 50 more over the weekend, the recalculation of the sentences of at least 800 others - and a potential compensation bill that could run into millions. Preparations for the releases began after the court laid down that all time spent by prisoners on remand should count against concurrent sentences, overturning a legal interpretation dating from 1982.
In Strasbourg, the European Court of Human Rights ruled that the UK had violated the rights of a Sikh independence campaigner by unlawfully holding him in jail without trial on grounds of "national security" pending deportation to India, where he faced torture and possible death.
While Mr Howard will seek to regain the political initiative by backing next week's Private Member's Bill to outlaw conspiracy or incitement to commit acts of terrorism abroad, the double defeat came at the end of what was already a bleak week. The Court of Appeal ruled on Wednesday that he must reconsider the naturalisation applications of the Egyptian-born Mohammed al-Fayed, chairman of Harrods, and his brother Ali, who had not been treated fairly.
In yesterday's High Court case, Lord Bingham, the Lord Chief Justice, Lord Justice Rose and Mr Justice Blofeld swept away the current rule under which prisoners jailed for more than one offence could count only the period of remand which applied to the longest sentence they received. Until yesterday's ruling, months of other remand time could not be taken into account at all.
The two prisoners who brought the case, Michelle Evans, 22, who was at Brockhill Prison, Worcestershire, and Paul Reid, 19, at Onley Young Offenders Institution, Rugby, walked free within minutes of the judges declaring they should be freed forthwith.
Soon afterwards, the Sikh activist Karamjit Singh Chahal was celebrating an emotional reunion with his wife Darshan and teenaged children Kirantreet and Dikaramjit after Mr Howard authorised his release from Bedford jail within an hour of the ruling by the Strasbourg court.
Mr Chahal had been held in prison for six years and three months without knowing the allegations against him after a request for political asylum was turned down by the former Home Secretary Kenneth Clarke, but the accusation that he was a security risk meant that his right to challenge his detention in the UK courts was severely limited.
The Strasbourg court said it was unnecessary to consider the "untested but no doubt bona fide" allegations that Mr Chahal was a terrorism risk; the only relevant question was whether substantial grounds had been shown for believing he would be ill-treated in India.
The court ruled by a majority vote of 12 to 7 that deportation would put him at risk after considering evidence from Amnesty International, the US State Department and the Indian National Human Rights Commission. David Burgess, Mr Chahal's solicitor, said: "We are very, very pleased. We think it is a courageous decision by the court," adding: "It's as much an indictment of the UK courts as it is of the Home Office."
John Wadham, director of the human rights organisation Liberty, said: "We are delighted by the court's decision, which exposes the supine nature of our legal system. The Government's trump card of 'national security' has consistently overriden individual rights."