John McDonnell mounted a staunch defence of Jeremy Corbyn this morning after Labour posted a series of local election losses in early results.

The shadow chancellor said Labour had avoided “wipeout”, as early results showed a net loss of 119 seats, as well as defeat in the West of England metro mayor contest, and argued that the party’s policies were proving “extremely popular”.

He was speaking at the end of a night when Labour lost control of two key Welsh councils, while the Tories had made a net gain of 147 seats, and UKIP suffered a meltdown.

“It has been tough, there is no doubt about that, but it hasn’t been the wipeout that some people predicted or that polls predicted.

“In other areas we have done much better than people expected. Look at what happened in Wales – those areas that were targeted by the PM herself like Newport, we retained control [as well as Cardiff and Swansea].”

McDonnell, who is one of Corbyn’s closest allies, highlighted the difficulties facing Labour but, as critics circled in expectation of a dire general election performance, he said Corbyn’s policy agenda could help bolster the levels of support.

“I am not underestimating the challenge we face right the way across the country,” he told the Today programme on BBC Radio 4.

“It isn’t the wipeout many predicted – it is much better. In fact if you look at he work on the ground we have turned out our vote in ways in which people didn’t expect and that’s as a result of the campaigning that has gone on both in terms of local candidates and also the national campaign itself where we have set out our policies – extremely popular policies – and this issue about Jeremy Corbyn: in the very place he campaigned, which was Cardiff, we have positive news, we held on to it.”

Senior allies to Corbyn have frequently blamed the media for Labour’s struggles in the polls, and some activists have booed journalists at party events, and the shadow chancellor renewed the criticism today.

He said “unbalanced” reporting had distorted voters’ view of the veteran socialist.

“The image that people have of Jeremy Corbyn have in some instances is not commending them to vote Labour,” McDonnell said.

“When we have a general election we get balanced airtime in the broadcast media – as a result of that people can hear more about policies and more about our candidates and more about our leader.

“I think they more they can make a fair judgment – what we are finding is what comes across is people like the policies, they see Jeremy Corbyn is an honest, decent but also principled person and that’s the sort of leader we want.

“The unbalanced media reporting of the last two years virtually has actually given a distorted view of who he is.”