Keir Starmer should resign if Labour loses the Batley and Spen byelection, the former shadow home secretary Diane Abbott has said, suggesting the party’s left wing would endorse a leadership run by Andy Burnham. Her intervention comes as Sadiq Khan became the second prominent Labour mayor to reach out to the rest of the country, writing in the Yorkshire Post about breaching the divide between the north and his city, London. Khan, widely considered a future party leadership contender, visited North Yorkshire on Wednesday, just a week after his re-election, which his team described as “a clear statement of his intent to build bridges between London and other regions”. Burnham, the mayor of Greater Manchester, has also raised eyebrows in the party for a new column in London’s Evening Standard and for comments in an interview with the Observer in which he made clear he would run for the leadership again should Labour fail to win the next general election. Labour faces a major test at the forthcoming byelection in the West Yorkshire seat of Batley and Spen, after its MP, Tracy Brabin, was elected mayor of West Yorkshire. The seat has a slim majority but has been Labour since 1997 and is likely to be a close fight with the Conservatives. “Support from the large minority ethnic electorate may enable the party to hold the seat and Starmer to hang on as Labour leader,” Abbott said. “But if Labour loses again, it must surely be curtains for him. And then, it may be that Andy Burnham’s time will have come.” The byelection comes after a bruising result for Starmer in Hartlepool, where the recent byelection was won by a Conservative landslide, and which sparked a bitter briefing war inside the party between Starmer and his deputy Angela Rayner, whose allies accused the leadership of trying to pin the blame on her. Abbott, a close ally of the former leader Jeremy Corbyn and a key figure on the party’s left, suggested the bloc would swing behind Burnham, though a leadership challenge would be highly unlikely to come from the mayor, who does not have a parliamentary seat. Writing for the Guardian, Abbott said it must “surely be curtains” for the Labour leader if another byelection is lost and said she had renewed faith in Burnham running for the leadership. Burnham was shadow home secretary under Corbyn and did not take part in the leadership challenge and mass resignation designed to remove Corbyn after the 2016 Brexit vote. He resigned his shadow cabinet role and parliamentary seat after being elected mayor in 2017. Abbott said that stance meant he was now seen “by the largely pro-Corbyn Labour party activist base as a neutral figure. Becoming mayor of Manchester also enabled Burnham to reinvent himself as a plucky insurgent, rather than a New Labour clone.” Abbott said a Burnham leadership run was “gaining traction after an impressive performance in the Manchester mayoral election”. Abbott herself ran in the 2010 leadership contest won by Ed Miliband, where Burnham was also a candidate. “In many ways he was an identikit New Labour apparatchik. But even then, you could see the glimmerings of an effort to shape his own brand, by stressing his “northern-ness,” she said. She said Burnham had missed his chance to be backed by the left in 2015, when Corbyn was a runaway winner. Abbott said Burnham was initially backed by the Unite leader, Len McCluskey, but said he was a “prisoner of his New Labour training” and alleged he had refused to go to a meeting with key union figures. Abbott said she had been impressed by Burnham’s challenge to Boris Johnson over the lack of financial support for Manchester during the coronavirus pandemic. “This defiance resonated. And not just in the north of England,” she said. “Now Burnham is being spoken about as the next leader.” Abbott’s endorsement of Burnham will be seen by many in the party as an acknowledgement that the party’s leftwing MPs do not have a sufficiently popular candidate of their own to challenge Starmer. Rayner, who also served in Corbyn’s shadow cabinet, is also seen as a leadership candidate but has reached a rapprochement with Starmer. “The left doesn’t trust her,” one MP said. Khan has positioned himself as more hostile to Corbyn’s leadership than Burnham, but comes from the party’s soft left. A vocal supporter of Starmer, the London mayor would be unlikely to back any leadership challenge. The London mayor visited the electric bus factory near Selby on Wednesday with Brabin, stressing his belief at how the capital could help heal north-south divisions. “When I was signed-in for my second term I pledged to build bridges between London and the rest of our country and to showcase how London can help the national recovery and the levelling up agenda,” Khan said. “Too often, the need to ‘level-up’ cities and regions across the UK is wrongly presented as a need to ‘level down’ other parts of the country, such as London – but that is in nobody’s interest. When London succeeds, the UK succeeds and vice versa.” A shadow cabinet source said: “It’s funny, I don’t remember Diane calling for Corbyn to resign after Copeland or any other byelection defeat. It’s clearer than ever that there are parts of the Labour party whose sole desire is for Labour to lose.”