WASHINGTON — Under pressure from fellow Democrats, Senator John Walsh of Montana, who has served in office for just six months, said Thursday that he was dropping his election bid, clearing the path for his party to nominate a new candidate.

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

Mr. Walsh met with his campaign manager and chief of staff in Helena on Wednesday night to discuss the decision, and then told campaign staff members in Billings on Thursday that he would step aside.

Appointed in February after Senator Max Baucus was named ambassador to China, Mr. Walsh will keep his seat through the end of this year. Montana Democrats have until Aug. 21 — when statewide candidates are certified on the ballot — to replace him.