GORDON Brown's Government tonight narrowly won the key Commons vote to extend pre-charge detention of terror suspects to 42 days.
After weeks of arm twisting and a series of concessions, the power for ministers to exercise the controversial "reserve" power was backed by 315 to 306, majority 9.
Cheers rang out as the result was announced to a packed chamber after a tense five-hour debate.
But there were also angry shouts from Tory opponents of the move, protesting about the role of DUP MPs, who were believed to have backed the Government.
Speaker Michael Martin had to intervene to restore order and quell the barracking.
Downing Street had earlier again forecast that the outcome of the vote was looking "very, very tight".
Facing one of the biggest tests of his leadership, the Prime Minister had been personally calling Labour MPs to make the case for the extension.
In a sign of how tight the situation was, Foreign Secretary David Miliband had to cut short a visit to Israel to attend the crucial divisions in Westminster.
The row over detention dominated the day at Westminster.
At question time, Tory leader David Cameron accused the Prime Minister of "ineffective authoritarianism" by proposing to detain terror suspects for 42 days without charge.
Urging MPs to follow their consciences, Mr Cameron branded the Government's plans "unworkable" and a "symbolic assault on liberty," which would "trash" the nation's hard-won civil liberties.
But Mr Brown insisted the change was needed to tackle increasingly sophisticated terrorism and accused the Tories of "opposition for opposition's sake".
He said he would rather act in "calmness" now than try to bring in "panic" measures at a time of emergency later.
Citing police backing, he insisted it was his duty to do not what was popular but what was right and necessary for the security of the UK.
Liberal Democrat leader Nick Clegg accused the Prime Minister of "playing politics with our civil liberties", and insisted the measures would be blocked by the Lords even if the Government wins backing from MPs.
When the key debate got under way in the crowded chamber, Home Secretary Jacqui Smith confirmed a fresh concession that suspects released without charge after being held under the scheme will be eligible for compensation.
Ms Smith said terrorist threat was "real and serious" and "more ruthless than any we have faced before" – raising the prospect of a radioactive 'dirty' bomb being used in a future plot.
"We are not proposing a permanent, automatic or immediate extension to pre-charge detention beyond 28 days," she said.
"Instead the Bill contains a reserve power that can only be used in exceptional circumstances, only with the support of the Director of Public Prosecutions, only with the backing of Parliament in a vote in both Houses, only with strong judicial safeguards and only for a temporary period before automatically lapsing."