Ministers face a legal battle over their plans to make terror offenders serve longer in prison, a former government adviser has warned.
Under the changes, such prisoners would no longer be automatically freed at the halfway point of their sentences.
But ex-independent reviewer of terror legislation Lord Carlile said the plans "may be in breach of the law".
The emergency legislation follows two attacks by men convicted of terror offences in London in recent months.
On Sunday, Sudesh Amman, 20, stabbed two people on Streatham High Road, south London, before he was shot dead by police.
He had been released from jail 10 days earlier and was under police surveillance.
'Going to be challenged'
Justice Secretary Robert Buckland told MPs that under the government's plans, terror offenders will only be considered for release once they have served two-thirds of their sentence and with the approval of the Parole Board.
The law change will apply to both current and future offenders, he said.
"We cannot have the situation... where an offender - a known risk to innocent members of the public - is released early by automatic process of law without any oversight by the Parole Board," he said.
The government has also said it will consider making new legislation to ensure extremists are more closely monitored on release and review whether the current maximum sentences for terrorist offences are sufficient.
Lord Carlile, a crossbench peer and former independent government reviewer of terrorism legislation, told BBC Two's Newsnight the plans went too far.
"The decision to lengthen the sentences of people who've already been sentenced and therefore expected to be serving half the sentence may be in breach of the law.
"It's certainly going to be challenged," he said.
"In any event, lengthening the sentence doesn't solve the problem because those individuals are still going to have to come out of prison at some point."
Lord Carlile called for tougher restrictions on released prisoners, such as the reintroduction of control orders which were scrapped by the Coalition government in 2011.
The Law Society of England and Wales said sentencing changes that applied retrospectively risked "clogging up an already overloaded system" because they could lead to more prisoners appealing against their sentences.
Its president, Simon Davis, said: "If the licence period is instead spent in custody, we risk releasing inmates without any supervision, without any transition and without any opportunity for the probation service to recall them to prison if there are concerns about their post-release behaviour."
Amanda Pinto QC, chair of the Bar Council, said such a reform "should be the subject of careful consideration to ensure that it complies with the rule of law".
The pressure group Liberty said it was "dangerous" and counter productive to apply the measures retrospectively.
However, the Parole Board for England and Wales welcomed the plans, saying "our over-riding priority is the protection of the public".
Although plans for the Parole Board to decide if people convicted of terrorism offences should be released after serving two thirds of their sentence were in the Queen's Speech, there were no proposals at that stage for the measures to apply retrospectively.
All that changed after the Streatham attack - the third incident involving convicted Islamist extremists in two months.
Ministers are clearly concerned about the risks posed by other prisoners serving sentences for terrorism who are due to be let out: there's about one release, on average, every week.
But the measures, if approved by Parliament, will almost certainly be the subject of a challenge in the courts. Is it fair that a prisoner who's been convicted and sentenced under one set of rules suddenly finds themselves locked up for longer under a different set of rules?
The government is likely to justify its approach on the grounds of national security, so prepare for an epic legal battle that may well end up at the Supreme Court.
Three people were taken to hospitals following Sunday's attack, including the two stabbing victims.
One victim, a man in his 40s, is now said to be recovering after sustaining injuries that were initially thought to be life-threatening. Another, a woman in her 50s, has been discharged from hospital.
A third woman in her 20s suffered minor injuries, thought to have been caused by broken glass from the gunfire.
The attack comes after convicted terrorist Khan fatally stabbed Saskia Jones and Jack Merritt at Fishmongers' Hall near London Bridge on 29 November last year.
Khan had been released from jail on licence in 2018, half-way through a 16-year sentence for terrorism offences.
This prompted a raft of measures to be proposed by the Home Office in January.