Labour MP Ian Murray has been reselected as a candidate in the next general election despite union opposition.
The Unite union accused the MP for Edinburgh South of consistently undermining the Labour leadership.
Party rules could have triggered a contest to replace him if the move was backed by a third of local members or affiliated unions.
However, all four constituency member branches have voted to reselect him.
Mr Murray said: "It is a huge honour to have been reselected as Labour's candidate in Edinburgh South for the forthcoming general election.
"Representing my home city of Edinburgh is a great privilege, and I have always put this constituency first and foremost."
'Hard-working and committed'
Unite had led the calls for Mr Murray's deselection over his criticism of the Labour leadership in Scotland and at Westminster.
It also claimed he had, on occasion, attacked the union.
After the reselection decision was announced, Mr Murray said he was grateful for the backing of "the overwhelming majority of trade unions".
He also thanked the "hard-working and committed local Labour party activists" for their continued support.
Mr Murray said: "My focus remains on standing up for the 80,000 people in my constituency, regardless of how they voted, and working tirelessly to secure a People's Vote to avoid a devastating Brexit."
Before becoming an MP, Mr Murray served for seven years as a councillor for the city's Liberton and Gilmerton ward.
The Edinburgh University graduate was elected to Westminster in 2010 and, after an SNP landslide in 2015, he was Labour's only Scottish MP.
In 2017, Mr Murray retained his Edinburgh South seat with 54.7% of the vote.
He increased his majority to 15,514 (32%) - the largest in Scotland.
He also increased his profile by leading the campaign to save Hearts Football Club from administration.
In February, Mr Murray declined to join seven Labour MPs who left to form an independent group in protest at the party's approach to Brexit and anti-Semitism under Jeremy Corbyn.
At the time Mr Murray said Mr Corbyn should "listen and learn and decide if he wants to keep the Labour Party together".