WASHINGTON — The fast-food executive Andrew F. Puzder withdrew his nomination to be labor secretary on Wednesday as Republican senators turned sharply against him, the latest defeat for a White House besieged by infighting and struggling for traction even with a Republican-controlled Congress.

The toppling of one of President Trump’s cabinet picks was a victory for Democrats, unions and liberal groups that had been attacking Mr. Puzder’s business record and his character since he was chosen in December. Conservative publications, including National Review and Breitbart, had also expressed resistance, zeroing in on Mr. Puzder’s employment of an undocumented immigrant as his housekeeper.

And records from his 1988 divorce, disseminated Tuesday night by opponents, resurfaced spousal abuse accusations that made some Republican senators uncomfortable. His ex-wife had recanted those accusations, but senators from both parties privately screened a videotape from “The Oprah Winfrey Show” that featured her laying out the charges while in disguise.

The opposition from Republicans was broad, and the reasons varied. Among the senators who expressed concerns were John Thune of South Dakota, Rob Portman of Ohio, Thom Tillis of North Carolina, Susan Collins of Maine, Johnny Isakson of Georgia, Lisa Murkowski of Alaska and Tim Scott of South Carolina, more than enough to scuttle the nomination.