Media playback is unsupported on your device Media caption Theresa May: "We are engaged in a struggle that will go on for many years"

Police and security services will get new powers as the UK faces a terror threat "perhaps greater than it has ever been", the home secretary says.

Unveiling a new counter-terrorism bill, Theresa May said the UK faced a security struggle "on many fronts".

Schools, universities and councils will be required to take steps to counter radicalisation.

Internet providers will have to retain Internet Protocol address data to identify individual users.

Speaking at a counter-terrorism event in London, Mrs May told an audience "the time is right" for enhanced security measures.

She spelled out the scale of the threat to the UK, specifying that 40 planned terror attacks had been foiled since the 7 July bombings in London in 2005.

The terror threat level in Britain was raised from "substantial" to "severe" earlier this year in response to conflicts in Iraq and Syria.

Image copyright Getty Images

The new legislation includes:

Counter-radicalisation measures - requirements that schools, colleges and probation providers help prevent people being radicalised

Changes to TPIMs - Terrorism Prevention and Investigation Measures - to allow the authorities to force suspects to move to another part of the country

Raising the burden of proof for imposing TPIMs from "reasonable belief" to "balance of probabilities"

Greater powers to disrupt people heading abroad to fight - including cancelling passports at the border for up to 30 days

Statutory temporary exclusion orders to control return to the UK of British citizens suspected of terrorist activity

Tighter aviation security - requiring airlines to provide passenger data more quickly and effectively

Banning insurance companies from covering ransoms

Forcing firms to hand details to police identifying who was using a computer or mobile phone at a given time.

But Mrs May warned that even the new powers in the bill would not fully address what she called a "capability gap" in the authorities' ability to monitor online communications.

She said: "Unfortunately, there is no agreement in the coalition - or for that matter with the opposition - about the need for the Communications Data Bill.

"We are going to have to wait until after the general election to address fully this increasingly urgent problem. "

She added that she remained "passionately convinced" police need access to more information about who is saying what online, in order to combat organised crime and networks of child abusers and terrorism.

Analysis

Image copyright AFP Image caption Authorities say more than 500 Britons have joined Islamic State

By Dominic Casciani, BBC home affairs correspondent

For a decade, British security and intelligence agencies have tried to counter threats from individuals inspired by al-Qaeda's ideology.

They're worried that the emergence of the so-called Islamic State has made that job far harder.

Twice before - in the wake of 9/11 and 7/7 - they asked ministers for more powers.

Each time there has been a difficult debate about the balance between those powers and personal liberties.

This coming bill - which is aimed at disrupting extremist activity - will face the same questions.

Against that background, a "Counter-terrorism Awareness Week" has something of a "Dig for Victory" spirit about it as the government and security chiefs seek public support ahead of potentially controversial legislation.

But PR tactics aside, the appeal is very squarely focused on the brutal fact that the police don't believe they can do this job alone.

Labour leader Ed Miliband pledged that his party would co-operate with the government but added that it would seek to scrutinise Mrs May's proposals.

Lib Dem leader Nick Clegg praised the identification of IP address users as "sensible" but said that the home secretary "wants to go a lot further" by reviving what he called the "disproportionate" measures of "the snoopers' charter".

Human rights group Liberty condemned Mrs May's programme as a "chilling recipe for injustice and resentment, closing down the open society she seeks to promote".

The Counter-terrorism and Security Bill will be introduced to Parliament on Wednesday.

The speech coincides with the start of a week-long police initiative - Counter-terrorism Awareness Week - involving more than 3,000 officers, to remind the public how they can help.

Media playback is unsupported on your device Media caption British transport police have been raising awareness of a terror threat as Andy Moore reports

Speaking earlier, Britain's counter-terrorism chief warned that police officers alone "cannot combat" the threat of extremism.

Metropolitan Police Assistant Commissioner Mark Rowley - the Association of Chief Police Officers' national policing lead for counter-terrorism - said: "So far this year, we have disrupted several attack plots and made 271 arrests but the eyes and ears of law enforcement and other agencies alone cannot combat the threat."

The threat posed by violent extremists has "evolved" and is no longer a problem solely stemming from countries like Iraq and Afghanistan.

"Now, they are home grown, in our communities, radicalised by images and messages they read on social media and prepared to kill for their cause," he said.

He said "nearly half" of those from the UK joining Islamic State, a militant group which has taken control of large areas of Syria and Iraq, were "recently radicalised and weren't previously on our radar".

On Sunday, the commissioner of the Metropolitan Police told the BBC that four or five terror plots had been stopped this year.

Police have previously prevented on average one plot a year, Sir Bernard Hogan-Howe said.