Gaetz, who resigned from the U.S. House of Representatives last week, was the subject of an Ethics Committee probe into allegations of having sex with a 17-year-old girl. He has denied wrongdoing.
"There is no time to waste on a needlessly protracted Washington scuffle, thus I'll be withdrawing my name from consideration to serve as Attorney General," Gaetz wrote in a post on X. "Trump's DOJ must be in place and ready on Day 1."
Gaetz, who was nominated last week, faced questions over his qualifications to serve as the country's top law enforcement official and his past conduct. He was investigated by the Justice Department for nearly three years into potential sex trafficking violations, a probe that ended last year without charges being brought.
Some Republican senators expressed misgivings about his nomination, though none had said publicly they would outright oppose him.
Republican Senator Cynthia Lummis said Gaetz's decision would give Trump the opportunity to nominate an attorney general “with fewer headwinds in the Senate.”
(Reporting by Andrew Goudsward, Doina Chiacu and Ismail Shakil; Editing by Scott Malone and Daniel Wallis)

WASHINGTON, DC - MAY 14: Rep. Matt Gaetz (R-FL) waits for a hearing to begin with the House Armed Services Subcommittee on Cyber, Innovative Technologies, and Information System in the Rayburn House Office Building on May 14, 2021 in Washington, DC. Appearing before the subcommittee the same week as the ransomware attack on the Colonial Pipeline, Paul Nakasone, director of the National Security Agency (NSA) and Eoyang took questions regarding the Defense Department’s preparations for action to prevent future cybersecurity attacks. (Photo by Anna Moneymaker/Getty Images)