Boris Johnson has thrown housebuilding plans into confusion, by suddenly calling for an end to construction on flood plains.

Around 9 per cent of new homes in England are built on land where there is a “high probability” of flooding – and a recent investigation found that 10,000 are currently in the pipeline.

But, on the campaign trail in flood-hit Derbyshire, the prime minister said: “We've got to stop building on flood plains. We've got to stop building on areas which are vulnerable to flooding.”

Mr Johnson was put under pressure from a worker in Matlock, a few weeks after swathes of Yorkshire and the Midlands were devastated by severe flooding.

He said he had “a huge amount of sympathy” for residents who had suffered, adding: “It's incredibly distressing when that happens.”

However, a ban on building on flood plains would have huge consequences for ambitious targets to construct more homes and tackle the housing crisis.

The most recent statistics show that 9 per cent of new residential homes were built in areas defined as ‘National Flood Zone 3’, by the Environment Agency.

Those are sites with a “1 in 100 or greater annual probability of river flooding”, or half that risk of flooding from the sea.

The prime minister ran into difficulties at the start of the campaign, when he was heckled by flood-hit residents who shouted “Where’ve you been?” and “You took your time”.

Top 10 marginal seats to watch at the general election Show all 10 1 /10 Top 10 marginal seats to watch at the general election Top 10 marginal seats to watch at the general election North East Fife Currently held by the SNP with a majority of 2 Getty Top 10 marginal seats to watch at the general election Kensington Currently held by Labour with a majority of 20 Getty Top 10 marginal seats to watch at the general election Perth and North Perthshire Currently held by the SNP with a majority of 21 Getty Top 10 marginal seats to watch at the general election Dudley North Currently held by independent, formerly Labour, MP Ian Austin with a majority of 22 LivingInMediocrity Top 10 marginal seats to watch at the general election Newcastle-under-Lyme Currently held by Labour with a majority of 30 Derek Harper Top 10 marginal seats to watch at the general election Southampton Itchen Currently held by the Conservatives with a majority of 31 Rob Candish Top 10 marginal seats to watch at the general election Richmond Park Currently held by the Conservatives with a majority of 45 Robin Webster Top 10 marginal seats to watch at the general election Crewe and Nantwich Currently held by Labour with a majority of 48 Jaggery Top 10 marginal seats to watch at the general election Glasgow South West Currently held by the SNP with a majority of 60 Alec MacKinnon Top 10 marginal seats to watch at the general election Glasgow East Currently held by the SNP with a majority of 75 Christine Johnstone

The government was strongly criticised for a slow response to the flooding in Yorkshire and the Midlands, which claimed one life.

In Matlock, Mr Johnson said the government was spending an extra £4bn on flood defences, adding: “We will also be making sure that we invest in brownfield sites that will enable us to build the housing that our people need.

“The other thing we've got to do, we've got to put in long-term flood defences, but we've also got to be planting millions and millions more trees.

“It sounds crazy but it's true, you need to plant 30 million more trees on higher ground to deal with the water that is building up.”

Last month, a Greenpeace investigation found that almost 10,000 new homes are set be built on some of the most flood-prone areas of England, including in Sheffield and Doncaster.

More than 5,000 homes have been proposed in high-risk zones of Lincolnshire, where roads and thousands of acres of farmland were flooded in November.

Doug Parr, Greenpeace's chief scientist, described the plans as “literally planning for disaster”.