Emergency legislation will be introduced to end the automatic early release from prison of terror offenders, the government has said.
Justice Secretary Robert Buckland told MPs the change would apply to both current and future offenders.
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.
It follows two attacks by men convicted of terror offences in recent months.
On Sunday, Sudesh Amman, 20, was shot dead by police in Streatham, south London, after stabbing two people. And in November two people were killed near London Bridge by Usman Khan.
Amman was released from prison towards the end of January, while Khan was out on licence from prison when he launched his attack in central London.
Mr Buckland said the latest attack made the case “for immediate action”.
“We cannot have the situation, as we saw tragically in yesterday’s case, 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.
He said the new legislation would mean people convicted of terrorism offences will no longer be released automatically after they have served half of their sentence.
Because we face “an unprecedented situation of severe gravity”, the legislation will also apply to serving prisoners, Mr Buckland said.
The Ministry of Justice said the legislation would be introduced “when parliamentary time allows”.
The government will also consider making new legislation to ensure that extremists are more closely monitored on release and will review whether the current maximum sentences for terrorist offences are sufficient.
Human rights group Liberty described the government’s actions after recent terror attacks as a “cause of increasing concern for our civil liberties”.
Clare Collier, an advocacy director for the campaign group, said: “From last month’s knee-jerk lie detector proposal, to today’s threat to break the law by changing people’s sentences retrospectively, continuing to introduce measures without review or evidence is dangerous and will create more problems than it solves.
“It’s clear the UK’s counter-terror system is in chaos and desperately needs proper scrutiny and review.”
Responding to the government announcement in the Commons, shadow justice secretary Richard Burgon said the justice system was in “crisis” due to funding cuts.
“The government cannot use sentencing as a way of distracting from their record of bringing the criminal justice system to breaking point,” he said.