Nick Clegg has said he is "really sad" at the Liberal Democrats' election results after a bruising night for the coalition left him facing the prospect of seeing his party's once mighty local government base drop to its lowest figure for two decades.

The deputy prime minister insisted, however, that his party would continue to play its role in government, particularly in dealing with the economic crisis.

Speaking outside his London home, Clegg said: "I am really sad that so many colleagues and friends, Liberal Democrat councillors who have worked so hard, so tirelessly, for so many years for communities and families in their local areas, have lost their seats and I want to pay tribute to all the great work they have done."

Labour's deputy leader, Harriet Harman, hailed the results as proof that the party was "back in business", having made sweeping gains across the north, the Midlands, and even some key suburban southern marginals.

The Conservatives, who hope to see Boris Johnson declared victorious in the London mayoral race against Ken Livingstone when the votes are counted later on Friday, were making light of their losses.

William Hague, the foreign secretary, told BBC1's Breakfast: "These results – while it is never a good feeling to lose councillors – are well within the normal range of mid-term results for governments, and I think not so good for the opposition, who are not getting 40% of the vote.

"There is no tidal wave running for anybody else," he said. "These elections are a test for the opposition as well as the government, and they are not passing that test."

As results continued to come in, Harman claimed Labour was "back in touch" with voters, in contrast to the government, which had both coalition parties suffering widespread losses.

Psephologists predicted that Labour was on course to gain more than 700 seats in local councils and was winning about 39% of the vote in elections conducted on a low turnout of about 32%. The Tories were taking 31% of votes, triggering laments from some within the party that it was not being "Conservative enough".

The Lib Dem party was taking 16% and was braced to see its share of the councillor base fall below 3,000 for the first time since the party was formed in 1988, prompting the Labour peer Lord Prescott to declare an "Armacleggon".

By Friday morning, Labour had gained control of 22 councils, including Birmingham and Southampton. The party also gained Harlow, Plymouth and Great Yarmouth directly from the Conservatives, and hoovered up all the Lib Dem seats up for grabs in Manchester.

In Wales, Labour gained control of Caerphilly council in south Wales in a landslide victory. With votes in one ward to be recounted later on Friday, the party had 49 seats, with 20 for Plaid Cymru and two independents. Labour also captured Newport, with three seats still to be decided.

Labour's Joe Anderson became Liverpool's first directly elected mayor.Harman told BBC Breakfast News: "We have the biggest share of the vote since 1997, and there was some positive response to Labour being back in touch and back in business. For the government to say this is just a mid-term — they should be listening to the voters, not just writing them off.

"Our share of the poll looks at though it is 39%. They are saying this is just mid-term worries. The government should be in a honeymoon period, they have only just been elected. People usually like to give the benefit of the doubt for a few years. They did with us."

While Labour enjoyed a good night, it was braced for a thumping defeat at the high-profile London mayoral election, where Johnson is tipped to give his party a much-needed fillip by beating his Labour rival Livingstone for a second time.

Ukip was on course for its best local election results, mainly at the expense of the Conservatives, polling as high as 20%.

David Cameron's dream of having elected mayors in Britain's major cities looks to be in tatters after the the idea was rejected in referendums across the country. Manchester, Nottingham and Coventry voted against having a mayor, while Birmingham, which was expected to vote yes, also seems set to vote no. Another six cities are voting, but most of those are expected to reject the proposal.

On the basis of early returns, the Conservative party co-chair, Lady Warsi, admitted it was a bad night for the Tories, and the communities secretary, Eric Pickles, predicted the party was on course to lose more than 450 seats.

Warsi triggered a furore after suggesting it was interesting that an increase in the number of Ukip candidates had coincided with a drop in those standing for the British National party.

In a worrying sign for Cameron, Conservative rightwingers warned that for Ukip to progress it needed to adopt a tougher stance on crime, immigration and Europe.

Gerald Howarth, a defence minister, said Cameron must consider Tory unhappiness over gay marriage and law reform after the election results.

In Plymouth – where the Conservatives suffered badly – Gary Streeter, a centrist MP, warned the leadership: "There has been a huge vote for Ukip. We need to work out a strategy for traditional Conservative voters shuffling off and voting Ukip because they don't think our leadership is Conservative enough. We need to show the decisiveness and surefootedness we have shown in the past … the Ukip vote is about a hard core of traditional Tory voters saying: 'We don't like the liberal decisions this government is starting to take.'"

Claiming the Liberal Democrat vote was disappearing across the country, Streeter said: "If the Liberal Democrat tail has been wagging the dog a little bit too much, it does not need to do that any longer. We can be tougher with them. We have got to be much more Conservative on crime, law and order – that is what our supporters are waiting, indeed gagging to see."

The Liberal Democrats experienced their worst results for a second year in a row, losing overall control of Cambridge — a stronghold for more than a decade. Its share of seats in Oldham fell from 21 to 14, and lost its one-seat foothold in Hastings and Sunderland.

Simon Hughes, the Liberal Democrat deputy leader, said he was hoping his party was not going to do as badly as last year when it lost more than 40% of the seats it had contested.

ILord Ashdown, the former party leader, said it was time for the party to "show its mettle".

He told Sky's Sunrise show that the Lib Dem losses were a result of the "tough decisions" the party had taken in government. "If we want to get this country to pull through the terrible crisis it's been left in, we're going to have to take some tough decisions."

The dispute between the two coalition partners underlines how tough it is going to be for Cameron and Clegg to keep their parties together. The latter is planning to use the next five days for a succession of media appearances in which he will seek to restate the reasons the party is in coalition.

Clegg will hold a joint event with Cameron on Tuesday, described as "Rose Garden 2" – a successor to the press conference that launched the coalition in May 2010 – at which the pair will argue that the fight to rebalance the economy remains the glue that keeps the two parties together in government. The Cameron-Clegg event will come a day before the Queen's speech, which sets out the legislative programme.

Government sources dismissed strong reports that a ministerial reshuffle would take place this weekend.

Lib Dem activists are concerned about whether the party can continue to absorb such an attrition rate without seeing the destruction of two decades of building a local council base. Clegg's immediate task, officials say, is to persuade his membership that a second successive year of reverses in local elections does not foreshadow inevitable electoral wipeout in 2015.

He is hoping to be able to point to results showing that the party is faring better in councils where it has an incumbent MP.