Pete Buttigieg, whose upstart presidential campaign has benefited from an early surge of donations and national attention, will no longer accept contributions from federal lobbyists, his campaign said Friday, bowing to pressure from fellow Democrats who want to reform the way campaigns raise money.

Mr. Buttigieg, the mayor of South Bend, Ind., was somewhat isolated among his rivals for the 2020 Democratic nomination because he initially accepted lobbyist money, putting him at odds with the more progressive wing of his party and its increasing demands to take big money out of politics.

He will return the contributions he had already accepted from lobbyists, which his campaign said totaled $30,250 from 39 individuals.

“Mayor Pete will not be influenced by special-interest money, and we understand that making this promise is an important part of that commitment,” the campaign said in an email to supporters.