London has resisted the national trend Reuters

London has offered Ed Miliband a ray of much-needed sunshine amid the gloom of the Ukip election surge, handing Labour some key gains and appearing immune to Nigel Farage's charms.

While Ukip denied the opposition the sort of national mid-term breakthrough it needs to feel secure about its 2015 election strategy, the capital bucked the trend and turned red.

Labour seized some key Tory councils including Croydon, where Tony Benn's granddaughter Emily was elected, and the jewel of Hammersmith and Fulham, branded David Cameron's favourite council and seen as a surprise victory for Miliband.

There were claims that local issues played a key part in Hammersmith, while Croydon Tories claimed votes for Ukip had handed the result to Labour.

But it was clear that, in London at least, the Ukip message had actually struggled to make any headway.

Party leader Nigel Farage put it down to the fact his party did not already have a strong organisation on the ground. And it is certainly true that Ukip has not previously scored any significant advances in the city, allowing it to build a strong base.

But it also seems the fact that London is a relatively young, and hugely diverse, city meant Farage's big anti-immigration selling point failed to get any traction. This is not the demographic Ukip appeals to.

Ukip's strongest performances against Labour came outside London in white working class areas where old Labour voters felt abandoned by the party and fearful about immigration and were believed to be more open to Farage's messages.

London does have a tradition of voting Labour and it took the character of Boris Johnson to take control of the city for the Tories from Ken Livingstone who had served as mayor and, previously, leader of the Greater London Authority, during times of Conservative governments.

It was also being pointed out that the London campaign, run by Miliband ally Sadiq Khan, had been significantly different from the national one, run by Douglas Alexander, and had concentrated heavily on cost of living issues.

That last factor could play into the wider debate Labour is now bound to have between those, led by Alexander, urging a limited offer at the general election and those pressing Miliband to be bolder.