Image copyright PA Media Image caption Police have been carrying out searches after the attack in Streatham

Emergency legislation designed to end the release of people convicted of terrorism offences halfway through their sentence has been presented to Parliament.

The measures - which would apply to England, Scotland and Wales - were drawn up after the attack in Streatham, south London, earlier this month.

The attacker, Sudesh Amman, had been freed from prison 10 days earlier.

The government wants the measures to become law by the end of the month.

MPs will consider all stages of the Terrorist Offenders Bill on Wednesday, before the Commons goes into recess on Thursday. The bill will then move to the Lords in time, ministers hope, for it to become law by 27 February.

The aim is to prevent the 28 February release of Mohammed Zahir Khan, who is the next convicted terrorist due to be freed after serving half his sentence for encouraging terrorism.

Under the government's proposals, people given a fixed or determinate sentence for a terror-related offence would be freed only with the agreement of the Parole Board - and after serving at least two-thirds of their term.

However, ministers have been warned they face a legal battle over the plans.

While the idea of involving the Parole Board in decisions has generally been welcomed, concerns have been raised about sentencing changes being applied retrospectively.

After convicted terrorist Usman Khan's attack at Fishmongers' Hall last November, Mr Johnson told the BBC's Andrew Marr: "You cannot retrospectively change the basis on which someone is... sentenced."

The bill would affect about 50 prisoners who were convicted under existing rules, which allow for release halfway through a sentence.

'Release arrangements'

Lawyers for some of the inmates are believed to be preparing a legal challenge, although ministers claim they are not extending sentences, merely changing the way they are administered.

The government believes the changes will not fall foul of the UK's obligations under the European Convention of Human Rights, which outlaws signatory nations imposing longer sentences than those "applicable at the time the criminal offence was committed".

The bill states that the government considers that "release arrangements are part of the administration of a sentence, which can change without breaching an offender's human rights".

Labour and the SNP have signalled they support the principle of the legislation but need to scrutinise the details.

Leader of the House of Commons Jacob Rees-Mogg has said he expects the Lords, in which the government does not have a majority, to deal with the bill with "reasonable" speed given the urgency of the situation.

It comes after Amman stabbed two people on a busy high street before he was shot dead by police.

He had recently been released halfway through his sentence for terror offences and was under police surveillance.

And in November last year, Khan, who had been released halfway through his 16-year sentence, fatally stabbed two people at Fishmongers' Hall near London Bridge.