Gordon Brown has set out the government's plans for its latest anti-terror bill.
The prime minister has called for cross-party consensus on measures to tackle terrorism.
Mr Brown had insistented that in rare cases it will be necessary to increase the 28-day limit for detention without trial - 18 months after the government struggled to extend the previous limit of 14 days.
The prime minister is keen to avoid a parliamentary battle on the matter, and acknowledged criticisms and suggestions from civil liberties group Liberty and opposition politicians.
Mr Brown tentatively mooted the option of a 56-day limit on detention with trial. He argued this could be necessary in extreme cases with complex evidence or where police had been forced to intervene early to prevent an attack.
He insisted adequate safeguards would be in place, proposing each seven-day extension be separately approved by a High Court judge and MPs kept informed about each individual case.
Less controversially Mr Brown proposed the introduction of post-charge questioning, which he added would further reduce the need to extend the 28-day detention without charge limit.
The prime minister confirmed reports in the Sun, that he would deport 4,000 foreign convicts by the end of the year, partly to relieve prison overcrowding.
He announced plans for a new uniformed border force, combining all checks upon entry to the UK.
He confirmed foreign nationals will also be made to carry biometric ID cards from the end of 2008.
Tony Blair was defeated in his attempt to introduce a 90-day limit and the Conservatives accepted the 28-day period as a compromise measure.
The former home secretary, John Reid, called for an extended limit earlier this year, although opposition politicians pointed out he failed to provide any evidence in support of this.
His successor Jacqui Smith told MPs yesterday Mr Brown would be prepared to set out a detailed case for extending the time police have to question suspects.
Ms Smith told the Commons home affairs select committee "the time is now right" to consider extending the limit.
She argued the complexity of recent cases meant police needed more time to question suspects. She said 2,000 terrorists were now actively engaged in plots in the UK, up from 1,600 nine months ago.
Ms Smith told MPs: "There is already evidence of us stepping up to the point of 28 days. All of this creates what I would argue is a trend of analysis towards a position where it is legitimate for us to consider again the case for going beyond the current situation of the maximum 28 days.
"The document will outline what we know about that trend and will contain a discussion of the alternatives, but it will not plump for one solution."
Also addressing the home affairs select committee yesterday, justice minister Jack Straw said the government wanted to look at ways to prevent Muslims becoming radicalised in prison.
"It is a matter of concern to the whole of the Prison Service and to me, and is exercising us a lot as to how we handle those prisoners who are likely to become proselytisers and evangelisers," he told MPs.