President Donald Trump on Monday vowed to allow into the United States people who "want to love our country," defending his immigration and refugee restrictions as he made his first visit to the headquarters Monday for U.S. Central Command.

Trump reaffirmed his support for NATO before military leaders and troops and laced his speech with references to homeland security amid a court battle over his travel ban on people from seven majority-Muslim countries. He did not directly mention the case now before a federal appeals court after a lower court temporarily suspended the ban.

"We need strong programs" so that "people that love us and want to love our country and will end up loving our country are allowed in" and those who "want to destroy us and destroy our country" are kept out, Trump said.

"Freedom, security and justice will prevail," Trump added. "We will defeat radical Islamic terrorism and we will not allow it to take root in our country. We're not going to allow it."

Trump touched upon various alliances in his remarks, noting, "we strongly support NATO."

He spoke Sunday with NATO Secretary General Jens Stoltenberg. A White House statement said the two "discussed how to encourage all NATO allies to meet their defense spending commitments," as well as the crisis in Ukraine and security challenges facing NATO countries.

Trump once dismissed the trans-Atlantic military alliance as "obsolete," and he would decide whether to protect NATO countries against Russian aggression based on whether those countries "have fulfilled their obligations to us."

Earlier, Trump sat down for lunch with a room full of troops in fatigues from the Army, Navy, Air Force and Marines, as well as senior members of his White House staff.

Trump made small talk with some of the soldiers, discussing everything from football to military careers.

"Gonna make it a career?" Trump asked one person.

"C'mon, you have to stay," he urged another.

Trump also hailed New England Patriots quarterback Tom Brady, saying he "cemented his place" in football history after his fifth Super Bowl win Sunday.

Trump, who is also commander in chief of the U.S. military, stopped at the base on the way back to Washington after his first weekend away from the White House. Trump spent the weekend at his estate in Palm Beach, Florida, with first lady Melania Trump, who had not appeared in public since shortly after her husband took office.

At MacDill, the president was briefed by CENTCOM and SOCOM leaders. A number of his advisers, including Gen. Joseph Dunford, the chairman of the Joint Chiefs of Staff, and Michael Flynn, Trump's national security adviser, also attended.

Trump met with Florida Gov. Rick Scott before delivering his remarks, telling the crowd at CENTCOM that Scott's endorsement of his candidacy for president "makes him a better friend of mine," adding that with those who don't offer their endorsement, "it's never quite the same."

CENTCOM oversaw a recent raid by U.S. special operations forces on an al-Qaida compound in Yemen, the first military operation authorized by Trump. A Navy SEAL, Senior Chief Special Warfare Operator William "Ryan" Owens, 36, of Peoria, Illinois, was killed, making him the first known U.S. combat casualty under Trump.

Three other U.S. service members were wounded in the operation. More than half a dozen suspected militants and more than a dozen civilians were also killed, including the 8-year-old daughter of Anwar al-Awlaki, a radical cleric and U.S. citizen who was targeted and killed in 2011 by a U.S. drone strike.

Trump made no mention of Owen or the raid in Yemen during his remarks Monday, but he paid recognition to the sacrifices of American military families and the spouses of American soldiers, vowing his support to those who risk their lives for the country.

"We protect those who protect us, and we will never ever let you down," he said.