Both the Conservatives and Labour have been punished by voters in local elections, with early results showing dissatisfaction with the two main parties, while the Liberal Democrats, Greens and independents picked up large numbers of seats.

The Lib Dems were particularly buoyant, gaining nearly 300 seats so far and a series of councils, including taking Bath and North East Somerset, and Cotswolds district council from the Conservatives.

The party was hoping for its best set of council results since 2004, in the aftermath of the Iraq war, though the gains followed poor results the last time these seats were contested in 2015, at the nadir of the Lib Dems’ post-coalition unpopularity.

The Lib Dem leader, Vince Cable, said his party was “the big winner” of the vote. He said: “Voters have sent a clear message that they no longer have confidence in the Conservatives, but they are also refusing to reward Labour while the party prevaricates on the big issue of the day: Brexit.”

The Conservatives have so far lost more than 400 seats. The party chair, Brandon Lewis, said dissatisfaction with the Brexit logjam had made an already tricky set of elections even worse.

“I always said this would be a tough night for us [and] it has been a tough night,” he told Sky News. “The frustration that our candidates, our activists and of course the public rightly have that parliamentarians have hit on this impasse – we’ve got to deliver on that.”

Liberal Democrat activists celebrate winning control of Bath and North East Somerset council on Friday morning. Photograph: Rod Minchin/PA

Tim Warren, who had led Bath and North East Somerset for the Tories, and lost his own seat, said he and his colleagues were on the receiving end of “a kicking for something that wasn’t our fault”.

The Lib Dems swept to control of the council, taking 37 seats, including the ward covering the home of the Tory Brexiter Jacob Rees-Mogg, to get an overall majority of 15.

Warren said: “The people that voted to remain blame us for leaving and the people that voted to leave blame us because we haven’t left yet. I think it’s almost anti-political.”

Labour could not similarly capitalise on the anti-Conservative mood, taking power at Trafford council but suffering a net loss of about 80 seats by Friday morning, and failing to win control in traditional bellwether areas such as Swindon or Stoke-on-Trent.

Labour sources argued that the type of seats being fought, compounded by numerous local factors, was expected to limit gains, but said the party was making gains in areas it would need to take in a general election.

However, some Labour backbenchers pronounced the results a verdict on the party’s position on Brexit, over which there has been recent internal wrangling about whether to back a second referendum.

The Exeter MP, Ben Bradshaw, said that locally Labour was doing well against the Conservatives, “but badly in the remain wards against Lib Dems and Greens”, blaming the party’s “ambivalent national position” on Brexit.

Remain sentiment and a backlash against the main two parties was helping the Greens to a good night overall, with the party making a net gain of almost 40 seats, including six seats in Folkestone, one of the councils where the Conservatives lost control.

Independent councillors also saw major gains, totalling more than 200 seats. However, Ukip was unable to capitalise. Even with Nigel Farage’s new Brexit party not involved, Ukip lost about 50 seats net, in part due to fighting considerably fewer than it did in 2015.

Change UK, the party formed by 11 remain-minded Labour and Tory MPs, also did not take part.

In the results tallied by early Friday, the Conservatives lost control in Peterborough, Basildon, Southend, Worcester, St Albans and Tandridge, but held on in Swindon and took Walsall from no overall control.

Labour lost control in Hartlepool and Wirral and lost the mayoralty in Middlesbrough, where an independent, Andy Preston, was elected. It held strongly pro-leave Sunderland but lost 10 council seats.

The council leader, Graham Miller, said the party had paid the price for its stance on a possible second referendum. “The people of Sunderland have said, ‘We are just not accepting that.’ We have seen a massive protest vote on that issue tonight,” he said.

The Conservative Brexiter Bernard Jenkin said the results showed why Theresa May should depart immediately: “[Voters] can see that she has lost the plot. They can see she is not in control of events. Certainly among Conservative activists and council candidates there is an almost universal feeling that it is time for her to move on.”

Others had a wider interpretation of the voters’ message. The elections expert Prof John Curtice told the BBC: “Even without the challenge of the Brexit party or Change UK, the electoral hold of the Conservative and Labour parties on the British electorate is looking now as weak as it has done at any point in postwar British politics.”