The peer who co-wrote the legal mechanism by which Britain will leave the EU sparked fury last night after arguing that the country needed immigration because ‘we native Brits are so bloody stupid’.

Lord Kerr said the UK needed an influx of intelligent foreigners to keep us on the right path.

And he claimed the Leave side only won the referendum by ‘cleverly outsourcing xenophobia and racism’ to Nigel Farage – allowing the Ukip leader to make the sort of offensive claims that would boost the campaign.

Lord Kerr (pictured) said the Leave campaign won after 'cleverly outsourcing xenophobia and racism’ to UKIP leader Nigel Farage

Eurosceptic Tory MP Peter Lilley walked out of the event, hosted by a civil service think-tank yesterday, after the ‘odious’ comments were made.

The former Cabinet minister said he had considered reporting Lord Kerr for hate speech and being ‘racially abusive of the British people’.

In my view, immigration is the thing that keeps this country running Lord Kerr

Lord Kerr, a prominent Europhile, faced criticism earlier this month when he said Brexit was not ‘irrevocable’ and that the people might want to ‘think again’ once the terms become clear.

The crossbench peer helped drafted the Lisbon Treaty, whose Article 50 sets out the process by which members can leave the EU.

At the event, hosted by the Institute for Government, he said the influx of migrants was a ‘good thing’.

He said: ‘There’s a much deeper argument to have – and that is about whether immigration is good for you or bad for you. In my view, immigration is the thing that keeps this country running.

‘We native Brits are so bloody stupid that we need an injection of intelligent people, young people from outside who come in and wake us up from time to time.’

The peer blamed the referendum result on David Cameron’s ‘disastrous off-the-cuff “no ifs no buts” commitment’ to keep net migration to less than 100,000 a year.

In fact, he said, the Government would not have met the target even if all immigration from the EU had stopped overnight.

‘It’s completely true that the Leave campaign, by cleverly outsourcing the xenophobia and the racism to the Farage campaign, were able to salve their consciences it seems by pinning Cameron to the fact that we would only take back control when we left,’ he said.

‘But supposing we did stop all the immigration from the EU, we would not have met Mr Cameron’s target – he would have done a lot of damage to the country if he had met it, but it was in his power to meet it by stopping immigration from outside the EU. So the premise of the argument about immigration was false.’

He added: ‘In Wales and the North East there is a perception of an immigration problem. No political party in Britain is having the guts to address that issue.’

Lord Kerr, a former ambassador to both the EU and the US, said the civil service was opposed to leaving the EU. He said Theresa May’s insistence that the UK should be able to limit immigration as part of a future deal with the EU meant that ‘we are heading for a very, very hard and unpleasant Brexit’.

‘And why? Because it rests on a fundamental preconception which none of the three parties were brave enough to address.

‘That’s the principal problem: not the reality of immigration, which is a good thing; but the perception of immigration in the country and that pusillanimity of politicians.’

Mr Lilley said: ‘I think these comments revealed the contempt that some Eurocrats like Lord Kerr have for ordinary British people.

‘They think they are there to rule the country and hugely resent any interference by the electorate.’

He said he had considered reporting the peer for hate speech, but decided not to do so. ‘I don’t like the law to prosecute opinions however odious,’ he said.

Mr Lilley also criticised Lord Kerr for saying the housing crisis had nothing to do with immigration.

‘To say the British people are stupid and then to suggest that housing has nothing to do with immigration displays such profound stupidity that one wonders why he lectures other people,’ he said.

‘It is particularly odd coming from a man who is racially abusive of British people.’