The prime minister, Theresa May, had next month’s general election in her sights as she reacted to Conservative gains of more than 550 seats in the local elections and some mayoral wins where Labour had high hopes.

Jeremy Corbyn, the Labour leader, was also thinking of the general election, saying his party faced a challenge on a “historic scale”. But, while he accepted it had experienced “too many” defeats, he said “the results were mixed. We lost seats but we are closing the gap on the Conservatives”.

Despite Tory gains in Scotland, the SNP leader, Nicola Sturgeon, called the results there an “emphatic” win for her party, which made gains itself and remains the largest north of the border.

Ukip faced a near total wipeout of its county council seats, with Douglas Carswell - formerly its sole MP - saying the party was “finished” in an article for the Guardian.

Plaid Cymru, which made a net gain of 26 in Wales, said it had won a “significant gains”. Its leader,Leanne Wood, said: “The story of the night seems to be Plaid and Tory gains versus Labour and Ukip losses.”

In a 15-minute speech in Manchester on Friday night, Corbyn accepted Labour’s performance was mixed. He began, not by focusing on Andy Burnham’s emphatic win, but on a Labour hold in Oxfordshire – David Cameron’s old stomping ground.

We were defending a county council seat where our candidate, Laura, had a majority of 10. She now has a huge majority because there was a big swing to Labour in Oxfordshire.

Laura Price now has a lead of 126 over the Conservatives in Witney South and Central.

We’ve had results around that country that have been variable. I understand that, we all get that. I congratulate every Labour candidate for all the work they did in the election yesterday and the run-up to it, especially those that won in Cardiff, in Swansea, in Neath and Port Talbot, in Doncaster.

We gained seats in often very unlikely places. I was talking to some friends this evening in Kent, in North Ramsgate, where they gained some seats. Don’t let the media write this story, let us write the Labour story.

Several hours after Burnham’s triumph, Jeremy Corbyn came to Manchester for a victory rally. Hundreds of activists joined him on the steps of Manchester Central, the conference centre where the result had been announced.

Burnham was not among them.

Corbyn explained away the new mayor’s absence by saying: “I have spoken to Andy and he is already working hard on behalf of the people of Greater Manchester region.”

Burnham was in fact hard at work drinking champagne with his family and friends in what appeared to be Refuge, one of Manchester’s hippest restaurants, described by the Guardian’s food critic as “a drop-dead glamourpuss”.

Jeremy Corbyn: ‘We have five weeks to win the general election, so we can fundamentally transform Britain for the many not the few.’ Photograph: Peter Powell/EPA

The results were mixed. We lost seats but we are closing the gap on the Conservatives. I am disappointed at every Labour defeat in the local elections. Too many fantastic councillors, who work tirelessly for their communities, lost their seats.

We have five weeks to win the general election, so we can fundamentally transform Britain for the many not the few.

We know this is no small task – it is a challenge on a historic scale. But we, the whole Labour movement and the British people, can’t afford not to seize our moment.

The British people have been held back for too long. Labour will put more money in people’s pockets with a £10 real living wage, look after our pensioners by protecting the triple-lock on state pensions and give everybody the care and dignity they deserve by properly funding our NHS and social care system.

I urge everyone to vote Labour because things can – and will – change.

The Conservatives are making plans to pursue Labour heartland seats at the general election, after winning mayoral contests in north-eastern England and the West Midlands, as well as seizing control of 11 new councils.

Theresa May insisted she was “not taking anything for granted” but the local and mayoral results showed the Conservatives benefiting hugely from the collapse of Ukip’s vote across the country, including in areas of historic weakness.

The prime minister’s strategists have the confidence to go on the attack in June after the party swept up more than 500 new council seats in England, Wales and even Scotland.

It also pulled off a shock mayoral win in Tees Valley, a deeply Labour area in the north-east, and a narrow victory in the West Midlands, where former John Lewis boss Andy Street beat Siôn Simon.

Street, who became the favourite despite the dominance of Labour in the West Midlands, said he hoped the victory was the birth of a “new urban agenda” for the Conservatives.

Jeremy Corbyn made a brief stop at the victory party of Liverpool’s first metro mayor, Steve Rotheram, where he attacked the Tories for how they have run “food bank Britain”.

In an appearance lasting a few minutes, Corbyn congratulated Rotheram, his parliamentary private secretary, whom he said had often told him “what you need to be thinking, what you need to be doing, and which football team you should be supporting”.

Standing in front of a group of placard-carrying activists gathered on a hotel lawn, Corbyn acknowledged the party had had a difficult time in local elections elsewhere. The Labour leader pivoted to the general election, saying Labour would work to end zero-hour contracts and jobs paying less than minimum wage.

“We will not be a government that presides over food bank Britain or asks teachers to go on the school gates and collect funds to pay the teachers’ wages,” he said. He took no questions from reporters.

Rotheram told supporters voters have a “marmite reaction” to Corbyn, but said they were attracted to his policies. Speaking to the Guardian, Rotheram acknowledged the party faced an uphill struggle in a campaign the Tories are framing as a personality contest between party leaders. “I think you’ll see a narrowing of the polls as long as we’re able to argue on policy ... If the contest is about May vs Corbyn, that’s a lot more challenging,” he said.