WASHINGTON — President Donald Trump’s choice for Army secretary withdrew his nomination Friday afternoon after weeks of withering criticism over past statements he has made about gays and lesbians, Muslims and other groups.

Mark Green, a veteran and Republican state senator from Tennessee, issued a statement in which he said he was pulling his name from consideration to avoid creating distractions for Trump, Defense Secretary James Mattis "and many others, and their desire to Make America Great Again by preparing our military to face the many challenges in the world for the safety and security of our nation.

"And unfortunately due to false and misleading attacks against me, this nomination has become a distraction," he said. "Tragically, my life of public service and my Christian beliefs have been mischaracterized and attacked by a few on the other side of the aisle for political gain. "

Green is Trump’s second choice for Army secretary to withdraw. Trump’s first pick, Vincent Viola, the billionaire owner of the Florida panthers, withdrew his nomination in February, citing difficulties in divesting himself from his businesses. Trump then nominated Green for the job in April.

Almost immediately, Green, a physician, Iraq war veteran and West Point graduate who was deployed three times overseas, came under fire from advocacy groups for gays and lesbians and other minority groups over controversial comments he had made in the past.

Multiple LGBT groups have denounced Green’s nomination, calling him “a social issues warrior” who, as a Tennessee legislator, has worked to undermine LGBT rights. One of the groups, GLAAD, released audio from a radio program in which Green — discussing his sponsorship of a bill that would have forced transgender students to use the bathroom that matches their legal sex rather than their actual gender — said his responsibility as a state senator was to “crush evil.”

Others have pointed to Green’s sponsorship of legislation that would allow mental health practitioners to refuse to treat LGBT patients and his support for a bill that would effectively bar transgender high school and college students from using public restrooms.

“If you poll the psychiatrists, they're going to tell you transgender is a disease," Green said at a Chattanooga Tea Party event last September.

In addition to his record on LGBT issues, Green was facing opposition from a couple of Muslim groups — Muslim Advocates and the Council on American-Islamic Relations — for comments he has made that the organizations consider derogatory toward the Islamic faith and its followers.

At the Chattanooga event, Green said he doesn’t believe students should learn about Muslim beliefs and religious practices and claimed erroneously that Muslims don’t believe Jesus “was born from a virgin.”

Sen. John McCain, the Republican chairman of Armed Services Committee, which was to conduct Green’s confirmation hearing, called his comments “very concerning” and said he needed to explain himself to the committee. Several other members of the committee said they, too, found Green’s comments disturbing.

In the House, nearly three dozen Democrats sent a letter asking the Senate to reject Green’s nomination, arguing he cannot be trusted to ensure that lesbian, gay, bisexual and transgender soldiers are able to serve without discrimination or harassment.

A Pentagon official under former President Barack Obama and a group of 21 current and former faculty members at military service academies, war colleges and other military universities also came out against Green’s nomination, citing his history “of extreme statements and actions” which they said pose a “serious threat” to the military’s core values.

Sen. Tammy Duckworth, D-Ill., a former Army helicopter pilot, tweeted after Green announced his withdrawal that while she respects his service "he is not fit to lead the Army&made the right decision to withdraw his name frm consideration."

Green is the second Tennessean to withdraw his nomination for a position in Trump’s administration.

Andrew Puzder, a fast-food magnate whom Trump had chosen to lead the Department of Labor, pulled his name from consideration in February amid questions about his personal life, the business practices at some of his restaurants and revelations that he once employed an undocumented housekeeper.

Trump later filled the post with Alexander Acosta, whom the Senate confirmed in April.