The Terrorist Offenders (Restriction of Early Release) Bill cleared all its Commons stages today.
It will now progress to the Lords, where it is expected to move rapidly through the Upper House.
Ministers are hoping to get the law changed by February 27, before the next terrorist prisoner comes up for release.
It follows the Streatham terror attack earlier this month, in which Sudesh Amman, 20, stabbed two bystanders with a knife he had grabbed from a shop.
Amman had been jailed in December 2018 for possessing and distributing terrorist documents, but was freed midway through his sentence less than a fortnight earlier.
It was the second attack in three months to be carried out by a convicted terrorist, after Usman Khan, 28, killed two Cambridge graduates at Fishmongers’ Hall, near London Bridge, in November.
Khan had been released nearly a year earlier, halfway through a 16-year jail sentence.
Moving the Bill at second reading, Justice Secretary Robert Buckland told MPs today: ‘Given the risk that this cohort has shown already that they pose to the public, it’s vital that we pass this legislation rapidly before any more terrorists are automatically released from custody at the halfway point.
‘Therefore we’re aiming for this legislation to receive royal assent before the end of the month and with the support of this House I am confident that we can do this.’
The new legislation aims to make sure terrorist offenders serve two-thirds of their sentence before they are considered eligible for release, rather than the current halfway mark.
It will affect around 50 prisoners, who will also need to be reviewed by a panel of specialist judges and psychiatrists at the Parole Board before they are released.
Labour’s Yvette Cooper, who chairs the Home Affairs Select Committee, raised concern around the speed at which the legislation is being progressed.
She said: ‘It’s right that we do so in these circumstances, but the government must also recognise that it is not the ideal circumstances and to rush through legislation in a breathless way and to be honest, actually there have been many warnings that this was coming down the track.’
She also noted that the government had ‘known about the problem for some time’.
Khalid Mahmood, Labour MP for Birmingham Perry Barr, also voiced concerns about radicalisation in prison, adding that madrasas should be subjected to closer checks when they request permission to form.
He said: ‘No heed is given to the qualifications of the imam, whether they have the proper scrutiny in terms of their past and what they have done, whether they comply with any security checks at all or not.
‘So I think these issues are very, very important for us to look at and to see how we moved forward.’
He added: ‘There is still significant radicalisation that is taking place and we need to address it in the community.’
One of the key problems today is that politics is such a disgrace, good people don't go into government.