Iain McNicol, Labour’s longstanding general secretary, has stepped down, in the latest sign that Jeremy Corbyn is consolidating his grip on party machinery. McNicol had become a controversial figure for those on the Labour left after a row over the rules for the 2016 leadership race.

He is now expected to be replaced with a leftwinger, consolidating the number of key Corbyn allies in senior party roles. At recent elections to Labour’s ruling NEC the left enjoyed a series of victories, including for Momentum founder Jon Lansman.

McNicol said: “It’s been an absolute honour and a privilege to serve as general secretary of the Labour party. I have now decided to move on to pursue new challenges in the service of the Labour party and wider labour movement.”

Corbyn said: “I would like to personally thank Iain McNicol for his long and dedicated service to the Labour party.”

McNicol, who became general secretary under Ed Miliband, was closely involved in running Labour’s election campaign last year, when the leadership and staff at Labour headquarters worked closely together.

A close ally of McNicol claimed he had been in negotiations about his departure, but had not been forewarned that it would be announced on Friday night.

In a statement, Labour said he would remain in place in the short term to allow “a smooth and proper transition ensuring that the Labour party remains on an election footing”.

Manchester Central MP Lucy Powell said, “This is a real loss. Iain McNicol has steered the Labour Party through many turbulent times, made us debt free with a surplus, and overseen the huge expansion in our membership. He will be greatly missed.”

McNicol’s successor will be chosen by a vote of the party’s national executive committee. Corbyn’s office is expected to back Jenny Formby, the Unite officer who is deputy chair of the NEC. Other potential candidates include senior party executive Emilie Oldknow, and former Corbyn campaign organiser Sam Tarry.

McNicol had been general secretary since 2011. He is credited with having restored the party’s finances to health, clearing its debts and building up an election war chest.

But Corbyn’s team had always regarded him with suspicion. He had been widely expected to come under increasing pressure once the temporary truce between Labour’s warring factions ended following last year’s better-than-expected general election result.

Tom Watson, the party’s deputy leader, elected by members in 2015, is one of the few survivors of the pre-Corbyn Labour party who remains in a senior role.

This article was corrected on 24 February 2018. Tom Watson was elected as deputy leader by party members, not MPs.