Dunn released a statement to confirm she would stand aside after the United States Anti-Doping Association (USADA) informed her she had returned a positive sample.
The 34-year-old, who has never competed at an Olympics, was due to run in the 4x400m relay, an event the USA have won since the 1996 Atlanta Games.
"I have been informed by the US Anti-Doping Agency that a sample I gave at the US Olympic Trials contains an elevated testosterone/epitestosterone level," Dunn, the 2010 world indoor champion and 2009 relay world champion, said in a statement.
"While I work with USADA to resolve this matter, I am withdrawing from my relay pool position for the 2012 Olympic Games.
"I do not want any issue like this to distract from my team-mates' focus for the biggest meet of their lives.
"I wish Team USA best in London as I work toward resolving this matter."
USADA chief executive Travis T Tygart confirmed Dunn's initial urine sample showed traces of a banned synthetic testosterone. The organisation is currently testing her 'B' sample.
"In response to Ms Dunn's statements, USADA appreciates Ms. Dunn voluntarily removing herself from the Olympic team while the full facts surrounding her elevated T/E ratio and adverse carbon isotope ratio analysis (CIR) are evaluated," Tygart said in a statement.
"We are currently processing the B sample, and as in all cases all athletes are innocent until and unless proven otherwise through the established full, fair legal process which was approved by athletes, the US Olympic Committee, and all Olympic sports organisations."
Should Dunn return a positive 'B' sample she could accept sanction or take her case to arbitration.