The Scottish Labour party is to launch a fast-tracked leadership contest after Richard Leonard resigned as leader months before a Holyrood election. Leonard said he had decided over Christmas that the constant attacks on his leadership were undermining Scottish Labour’s ability to “get its message across”. Labour is trailing the Scottish National party by at least 35 points in opinion polls and is at risk of losing a dozen or more seats when Scotland goes to the polls on 6 May. The party confirmed it would launch a leadership contest immediately to guarantee Leonard’s successor is in position well before the election. Jackie Baillie, who has stepped up as interim leader, has agreed with Leonard that he can stand as a Labour candidate in May. Anas Sarwar, the centrist MSP who was recently made Scottish Labour’s constitution spokesman, and who lost to Leonard in the last leadership contest in 2017, is an early favourite for the post. Baillie urged different parts of the party to come together and said: “We face the fight of our lives in the run-up to the 2021 Scottish parliament elections.” Party sources said Leonard had had several clashes with senior colleagues and trade union leaders, and had lost the confidence of former allies on the Corbynite wing of the party who had become disillusioned at his approach. He was said to be guarded and unwilling to take advice. He narrowly survived a short-lived rebellion over his leadership by Labour MSPs in September. Tensions with Keir Starmer, the UK party leader, came to a head in late December when Leonard announced Scottish Labour would vote against the Brexit deal at Holyrood because of the economic damage he believed it would cause. That contradicted Starmer’s decision to back the UK government’s deal. Amid derision from their opponents, Leonard’s colleagues mounted a rapid damage-limitation exercise. The next day they claimed their stance was based on the UK government’s failure to include Holyrood in its Brexit planning. In a brief statement, Leonard accused the Scottish and UK governments of mishandling the Covid crisis but implied he no longer believed he was the best person to take them on. “I have come to the conclusion it is in the best interests of the party that I step aside as leader of Scottish Labour with immediate effect,” he said. “This was not an easy decision, but after three years I feel it is the right one for me and for the party.” Starmer thanked Leonard and said he should be “very proud” of his achievements, which included campaigning for the creation of a national care service in Scotland, jobs guarantees for unemployed youth and a fair rents bill. Nicola Sturgeon, the SNP leader and first minister, tweeted: “Despite our political differences, I’ve always liked Richard Leonard. He is a decent guy and I wish him well for the future.” In the 14 years since Alex Salmond and the Scottish National party claimed their first Holyrood election victory in 2007, Scottish Labour has had six leaders. Last summer Jackson Carlaw stepped down as Scottish Tory leader and was quickly replaced unopposed by Douglas Ross, a Tory MP.