The race to control the US Senate saw its first forced departure on Thursday, three months before November’s midterm elections, as Iraq war veteran John Walsh pulled out of the running in Montana following a plagiarism scandal.

Walsh, who was appointed as the temporary replacement for Democratic senator Max Baucus after Baucus was made ambassador to China in February, was trailing his Republican opponent in the polls, but his exit leaves his party scrambling to find an alternative candidate for the vulnerable seat.

His departure had been brewing for days, after revelations last month that he apparently copied large chunks of a final paper for his master’s degree at the US Army War College from a document published by the Carnegie Endowment put his campaign in a difficult position.

The allegations, first published by the New York Times, suggested that at least a quarter of Walsh’s 2007 thesis on Middle East policy was lifted from other sources without attribution.

After several days of cancelled public appearances and mounting pressure from local activists, Walsh announced he would pull out of the race on Thursday afternoon. He had until Monday to make the decision.

“I am ending my campaign so that I can focus on fulfilling the responsibility entrusted to me as your US senator,” he said in a statement to supporters. “You deserve someone who will always fight for Montana, and I will.”

Walsh was so far behind Republican congressman Steve Daines in the polls that his exit could actually give his fellow Democrats a boost. If the party can find a strong candidate quickly, it may conceivably help their chances of holding onto to the Senate seat.

Walsh, who was formerly Montana’s lieutenant governor, was appointed as interim senator by governor Steve Bullock after Baucus, who had already announced he was retiring in 2015, chose to take the ambassadorship in China.

Ironically, some party strategists had speculated that the White House chose to move Baucus to Beijing partly to make sure there was a sitting incumbent to fight for the crucial seat, which may prove key to determining whether Democrats hold onto control of the Senate.

Walsh is also not the first senator to be accused of plagiarism. Kentucky Republican Rand Paul, who is currently campaigning heavily for a rumoured presidential bid in 2016, largely shrugged off similar allegations last year.

Democrats in Montana will now hold a special nominating convention to decide Walsh’s replacement, with delegates drawn from local party committees aiming to select a new nominee by August 20. Walsh has said he will serve out the remainder of his term in the Senate.