A new poll shows that a majority of veterans — both current and former service members — said they approve of the job President Donald Trump is doing and approve of his handling of border security and terrorism.

The poll said that 56 percent of veterans said they approved of the job he is doing as president, versus 43 percent of veterans who disapproved.

In addition, the poll showed that 62 percent of veterans approve of Trump’s handling of border security, and 51 percent think the Trump administration has made the country safer from terrorism.

The poll was conducted by NORC at the University of Chicago for the Associated Press and was published Saturday. More than 115,000 midterm voters — including more than 4,000 current and former service members — were surveyed.

Overall, 48 percent of veterans said Trump has the right temperament to serve as president, 59 percent say he is a strong leader, and 46 percent were more likely to say that Trump cared about “people like you.”

The percent of approval was higher among male veterans than female veterans — 58 percent compared to 42 percent.

Broken down by race, white veterans approved of Trump at 62 percent, Latino veterans approved at 53 percent, and African-American veterans approved at 22 percent.

During the November midterm elections, nearly six in ten veterans voted for Republican candidates.

The poll comes amid a controversy over military support for Trump.

The president and First Lady Melania Trump took a surprise trip to visit U.S. troops stationed in Iraq and Germany over the Christmas holiday and were greeted with cheers and requests to sign Make America Great Again hats and take selfies with them.

In Iraq, when the president took the stage, troops clapped and cheered and chanted: “USA!”

One soldier told Trump he re-enlisted because of him, according to White House Press Secretary Sarah Sanders:

Powerful moment – Member of United States Army told the President he came back into the military because of him. And President Trump responded, “And I am here because of you.” I met him after and he gave me the patch from his arm. Incredible. #TrumpTroopsVisit pic.twitter.com/WmQf3b2K8X — Sarah Sanders (@PressSec) December 26, 2018

Troops’ excitement to see Trump prompted surprise among reporters. CNN questioned whether Trump had brought the MAGA hats with him and whether it was appropriate for troops to ask the president to sign them.

Reporters also claimed that Trump had accidentally revealed the location of a Navy SEAL team he visited at the Al Asad Air Base in Iraq.

.@FLOTUS Melania and I were honored to visit our incredible troops at Al Asad Air Base in Iraq. GOD BLESS THE U.S.A.! pic.twitter.com/rDlhITDvm1 — Donald J. Trump (@realDonaldTrump) December 26, 2018

The Air Force in Europe said troops had not violated any policies by bringing MAGA hats and asking the president to sign them. The Pentagon later also said no security protocols were violated.