Republican presidential nominee Donald Trump, in what was billed as a major foreign policy address, on Monday backed off past threats to withdraw from the NATO alliance -- saying that if he's elected, the U.S. will work with the 28-member bloc to defeat the Islamic State.

During his speech in Youngstown, Ohio, Trump called for working "very closely with NATO," describing radical Islamic terrorism as the dominant global threat and one that must be confronted at all levels.

In doing so, Trump acknowledged having previously described NATO as "obsolete" for not dealing adequately with terrorism.

"Since my comments, they have changed their policy," Trump said, calling this apparent development "very, very good."

Trump's latest NATO comments indeed mark a turnaround from warnings that if he's president, the U.S. might not come to the aid of alliance members if they are attacked by Russia or another country. Those remarks, made earlier this summer, drew heavy criticism from not only from Democrats and Republicans but also from NATO Secretary General Jens Stoltenberg.

“I will not interfere with the U.S. election campaign, but what I can do is say what matters for NATO. Solidarity among allies is a key value for NATO,” Stoltenberg said.

Part of the NATO treaty established in 1949 requires that if one member nation is attacked, all the other nations must come to that country’s defense.

Trump also on Monday called for an American policy shift, vowing to focus resources on stopping the spread of radical Islam.

“If I become president, the era of nation-building will be brought to a very swift and decisive end,” Trump said.

The Republican presidential nominee noted he opposed the Iraq war more than a decade ago, while blaming what he called the "disastrous" decisions of President Obama and former Secretary of State Hillary Clinton, his 2016 rival, for the spread of radical Islamic terror.

“We cannot let this evil continue,” Trump said of the radical Islam threat.

During his speech Trump proposed “extreme vetting” of Muslim immigrants and visitors to the United States, vowing once more to block those who sympathize with extremist groups or don't embrace American values. He said the policy would first require a temporary halt in immigration from dangerous regions of the world.

"We can never choose our friends, but we can never fail to recognize our enemies,” Trump said.

Ahead of Trump's address, Clinton and Vice President Joe Biden vigorously challenged the Republican nominee's preparedness to be commander in chief. Biden called Trump's views "dangerous" and "un-American" and warned that Trump's false assertions last week about President Obama founding the Islamic State could be used by extremists to target American service members in Iraq.

"The threat to their life has gone up a couple clicks," he said.

While Trump has been harshly critical of Obama's handling of the threat posed by the Islamic State, his own policies for defeating the group remain vague.

His most specific prescriptions Monday centered on changing U.S. immigration policy to keep potential attackers from entering the country.

Trump's campaign aides said a new ideological test for admission to the United States would vet applicants for their stance on issues like religious freedom, gender equality and gay rights. The government would use questionnaires, social media, interviews with friends and family or other means to determine if applicants support American values like tolerance and pluralism. The U.S. would stop issuing visas in any case where it cannot perform adequate screenings.

Trump did not clarify how U.S. officials would assess the veracity of responses to the questionnaires or how much manpower it would require to complete such arduous vetting. Nor did the campaign say whether additional screenings would apply to the millions of tourists who spend billions of dollars visiting the United States each year.

Trump also slammed Clinton, saying she lacks the "mental and physical stamina" to take on ISIS.

He said destroying the terror group would be the centerpiece of his foreign policy and he would partner with any countries that share that goal -- specifically singling out Russia as a nation the U.S. could have a better relationship with.

The Republican nominee's foreign policy address comes during a rocky stretch for his campaign. He's struggled to stay on message and has consistently overshadowed his policy rollouts, including an economic speech last week, with provocative statements, including his comments falsely declaring that Obama was the "founder" of the Islamic State.

Trump spent much of the speech building a case that Obama and Clinton are to blame for the creation of the terror group that has roiled the Middle East and carried out attacks in the West. He specifically highlighted the withdrawal of U.S. troops from Iraq in late 2011, arguing the move created a vacuum for terror groups to thrive.

Reiterating a favorite criticism of Republicans, Trump also panned the Obama administration for not using the phrase "radical Islamic terrorism" to describe sympathizers.

Obama, Clinton and top U.S. officials have warned against using that kind of language to describe the conflict, arguing that it plays into militants' hands.

Trump's immigration proposals were the latest version of a policy that began with his unprecedented call to temporarily bar foreign Muslims from entering the country -- a religious test that was criticized across party lines as un-American. Following a massacre at a gay nightclub in Orlando, Florida, in June, Trump introduced a new standard, vowing to "suspend immigration from areas of the world where there is a proven history of terrorism against the United States, Europe or our allies, until we fully understand how to end these threats."

That proposal raised numerous questions that the campaign never clarified, including whether it would apply to citizens of countries like France, Israel, or Ireland, which have suffered recent and past attacks. Trump had promised to release his list of "terror countries" soon. But aides say the campaign needs access to unreleased Department of Homeland Security data to assess exactly where the most serious threats lie.

Clinton pre-empted Trump’s speech at a rally earlier Monday with Vice President Biden in Scranton, Pa., where she claimed Trump often “has no plan” when it comes to foreign affairs. She also criticized him, before he softened his rhetoric on NATO, for past comments questioning America’s NATO commitments, accusing him of discussing “walking away from our European allies.”

The Associated Press contributed to this report.