Keith Vaz has seen off a challenge from a Momentum-backed candidate to replace him on Labour’s ruling body, despite a widespread social media campaign to oust him.

The veteran MP’s challenger, Asghar Khan, a Leeds councillor and postal worker, had the backing of several of the largest trade unions, including Unite, GMB, TSSA and CWU. Momentum, the grassroots campaign movement of Jeremy Corbyn supporters, made several videos in support of Khan’s candidacy.

The seat in contention was the BAME Labour position on the party’s national executive committee, which is allocated to members of the Labour Black Asian Minority Ethnic group. Vaz has been on the NEC for about a decade, but previously faced a court challenge over his election in 2012, where it was alleged that he was not a fully paid-up member of BAME Labour, despite standing to represent them.

In the video shared by Momentum, Josh Jackson, an activist, says: “It’s so vital we have people on the NEC who support Jeremy Corbyn’s bold agenda. The same agenda which got a resounding result at the last general election and defied all expectations.”

Last month, Khan used an open to letter announce his candidacy, which he said would mean “more grassroots BAME voices from outside Westminster on the Labour NEC”.

“I came to the UK without a word of English at 11 years old. I’m a postman, a councillor and a trade union rep,” he wrote. “I know the struggles working people face.”

I'm standing for the BAME Labour seat on the Labour NEC. We need a grassroots voice - here's my letter to members. pic.twitter.com/he5tqZzzyb — Cllr Asghar khan (@asgharlab) July 25, 2017

The result will come as a relief for Vaz after a turbulent year in which he resigned as chair of the home affairs select committee after a Sunday Mirror investigation, which claimed to show him meeting escorts and offering to pay for cocaine if it were brought to a future meeting. The Metropolitan police opened an investigation, but it was later closed without charge.

The BAME Labour election is seen by party insiders as part of a wider struggle between Labour’s moderate, Corbyn-sceptic wing, and leftwing backers of the Labour leader.

A bitter contest is also taking place over the summer for two places on Labour’s conference arrangements committee, which oversees what topics can be debated at the party’s annual conference. Seema Chandwani, one of the two Momentum-backed candidates, caused controversy last month with a blog in which she described MPs as “Judases” organising “meetings of group lynchings and constant cowardly bullying by a bunch of talentless morons”.

Billy Hayes, the former leader of the CWU trade union, is also running for the committee on a leftwing ticket. The Labour MP Gloria de Piero and Labour peer Michael Cashman are standing for re-election, backed by the centrist groups Labour First and Progress. Ballots close at noon on 8 September.