Republican presidential candidate Donald Trump is American troops’ preferred pick for commander in chief, according to a poll published Monday. Vermont Sen. Bernie Sanders was also a top choice for president among active military personnel. 

Trump earned around 27 percent of support among active-duty service members, and Sanders came in close behind at about 22 percent. The poll, conducted from March 9 to 14, surveyed 931 active troops, reservists and members of the National Guard.

By branches of service, Trump received the greatest support from the Army, at nearly 31 percent, and Sanders saw his strongest backing from the Navy, with almost 24 percent of support.

Trump has made appeals to veterans while on the campaign trail, but they have spoken out against the real estate mogul. Trump drew fire in July for incendiary comments about Arizona Sen. John McCain, a former Navy pilot, when he said the decorated Vietnam veteran was not a hero because “he was captured.” McCain was a prisoner of war for five years, while the real estate mogul received four draft deferments during the war.

“He does owe an apology to every single veteran who was captured and was a prisoner of war,” McCain said in July. Trump did not apologize.

Based on the survey, the most unpopular Republican candidates among members of the military were Ohio Gov. John Kasich, who received around 8 percent of support, and Florida Sen. Marco Rubio with 9 percent. Former Secretary of State Hillary Clinton was the least popular Democrat with the troops, earning around 11 percent of the vote.

More than half of those surveyed said they were not satisfied with the treatment of national security issues on the campaign trail — fewer than 5 percent were “very satisfied” with how the topic has played a role in the 2016 election season.