WASHINGTON — K. T. McFarland, who was a deputy national security adviser in the Trump administration and then was picked to serve as ambassador to Singapore, withdrew her ambassadorial nomination on Friday after it had stalled in the Senate.

Ms. McFarland’s nomination had become embroiled in the controversy over the Trump campaign’s contacts with Russian officials, with some senators left wondering if she had answered questions deceptively when asked if she knew of discussions between Michael T. Flynn, the former national security adviser, and a Russian ambassador.

“Unfortunately, some Democrats chose to play politics rather than move forward with a qualified nominee for a critically important post,” President Trump said in a statement released Friday by the White House. “I wish K. T. the best as she uses her considerable wisdom and skill as a commentator to explain to the American people how to make American foreign policy great again.”

Senate Republicans could have approved her nomination unilaterally, but the fact that it was never brought to a vote suggested that she had made even some of them uneasy.