Former leader says Ed Miliband will not gain anything if he tries to follow 'nasty and unpleasant' party led by Nigel Farage

Tony Blair has urged the Labour leader, Ed Miliband, and the rest of the mainstream political class to take on and confront Ukip, saying it would only confuse Labour's own supporters if it now ran on an anti-immigration platform.

He also urged Miliband to stay put on the issue of an in/out EU referendum, saying that yielding to the pressure of Ukip had not done the Conservative party any good to date.

Behind the Ukip facade was something pretty nasty and unpleasant, Blair told BBC Radio 4's Today programme.

The former Labour leader said: "For the Labour party, if it tries to follow Ukip either on its anti-European platform or, even worse frankly, on its anti-immigrant platform, all that will happen is that it will confuse its own supporters and will not draw any greater support."

Miliband has repeatedly apologised for Labour's lenient approach to immigration in the past, saying it had not understood enough about the downsides of globalisation for working-class communities.

But Blair said: "I would very strongly support the position we took both on immigration and Europe. I fought the 2005 election on a campaign against immigration from the then Conservative leader. I have always said, of course you have got to have proper controls on immigration, you to have to deal with those parts of the immigrant community that are rejecting the idea of integrating into the mainstream, but to allow that then to trend into anti-immigrant feeling is a huge mistake for the country."

He added: "People in Ukip always say other the politicians don't get it; I do get it and I get them. You look a little bit beneath that Ukip facade and you see something, in my view, pretty nasty and unpleasant".

With some in Labour urging the party to respond to the Ukip rise with a tougher anti-immigration stance or a commitment to an in/out referendum, Blair said: "The way to deal with Ukip is to stand up to them and take them on. What they are putting before people is a set of solutions that anybody who analyses where Britain has to be in the 21st century knows their solutions are regressive, reactionary and make Britain's problems worse, not better.

"Attitudes that are closed-minded, anti-immigrant, anti-EU, stop the world I want to get off, those attitudes don't result in economic prosperity or power and influence in the world."

He said London was a great capital city precisely because it had a mix of different people and had gained from the energy and ingenuity of immigrants. "By all means have rules and controls, but the idea that the problems of Britain are due to immigration is a backward and regressive step, and we should contend every inch of that argument."

Blair praised the way in which Nick Clegg had shown leadership in confronting the anti-EU mood in the country.

"To be fair to Nick Clegg – I don't want to damage him by saying this – over the past few years he has shown a quite a lot of leadership and courage as a leader.

"The problem for the Lib Dems is nothing to do with Europe. The problem they have is very simple: they fought the 2010 election on a platform quite significantly to the left of the Labour party and ended up in a Conservative government with a platform that is significantly to the right of Labour.

"If you voted for the Lib Dems in 2010 because you liked their total opposition to tuition fees you are going to be somewhat disappointed when you vote for a government that ends up tripling them. That is the problem the Lib Dems have and there is not really a cure for that."

In response to suggestions that support for mainstream parties was eroding, Blair said: "I still think there is a progressive majority in the country. It is up to us whether we put it forward.

He said the rationale for Europe was stronger than it had ever been. While the rationale for his father's generation had been about peace after decades of war, for today's generation it was about sharing power collectively.

Once seen as a candidate for the European Council presidency, Blair said: "Europe has got to get away from this notion that the whole purpose of Europe is to diminish the nation state, and recognise that Europe works best when nation states come together to cooperate when they need the collective weight of Europe to prevail."

He added: "For a country like Britain, if you want to exercise weight, influence and power in the world you have got to do it through alliances, and the obvious alliance for us is the one on the doorstep, the biggest political union and commercial market in the world, and that is the European Union."

But he said he recognised the desire for EU reform. "Europe should get out of doing some of the things it does not need to do. That is where the principle of subsidiarity is so important. Some of the rules and regulations coming out of Brussels could be handled at national level."

He said EU leaders would regain support if they showed they were "gripping the big issues and getting out of the things that irritate people".