Mr. Petraeus has long captured Mr. Trump’s imagination, but he comes with the baggage from not only his own scandal but also from having been C.I.A. director during the attack on the diplomatic outpost in Benghazi, Libya.

Mr. Graham, who also serves on the Armed Services Committee, said Mr. Petraeus would be “an extraordinary pick.” He described him as “one of the most uniquely qualified” of the people on Mr. Trump’s list, noting that he was the best known of all of them overseas, after his C.I.A. stint and his military career; in which he was the top commander in Iraq and Afghanistan.

Some Democrats signaled they would keep an open mind. Senator Dianne Feinstein of California, who will be the ranking minority member of the Judiciary Committee, said she had “great respect for his mind.” She described his mishandling of classified material as “the one question that comes up,” but did not suggest it would prevent his confirmation.

But Democrats would be likely to use a Petraeus nomination as a way to portray Mr. Trump as a hypocrite. He hammered Hillary Clinton throughout the campaign for her use of a personal email address and computer server, saying that she should be jailed, even after the F.B.I. director, James B. Comey, said her misconduct had been less serious than that of Mr. Petraeus.