JILL COLVIN and STEVE PEOPLES

The Associated Press

PHOENIX (AP) — Donald Trump is retreating from his vow to deport the nation's entire population of people living in the country illegally, even as he sticks with an aggressive tone on illegal immigration and remains committed to building a physical wall along the U.S. border with Mexico.

The Republican nominee for president promised Wednesday to remove millions of people living in the country illegally if elected president, warning that failure to do so would jeopardize the "well-being of the American people."

"Anyone who has entered the United States illegally is subject to deportation," Trump said in a highly anticipated speech, which took place mere hours after his surprise meeting with Mexican President Enrique Pena Nieto in his first trip abroad as the GOP nominee.

But the billionaire New Yorker also said the effort of a proposed immigration task force in a Trump administration would focus on removing criminals, people who have overstayed their visas and other immediate security threats.

Left unanswered by Trump: What would happen to those who have not committed crimes beyond their immigration offenses?

Aimed at ending weeks of confusion over just where he stands on immigration, Trump's fiery speech was filled with applause lines for his loyal supporters.

Any person living in the country illegally who is arrested "for any crime whatsoever," he said, will immediately be placed into deportation proceedings. "There will be no amnesty," he added, saying immigrants in the country without permission who wish to seek legal status or citizenship must return to their home countries in order to do so.

But there was no direct mention of a core promise of his primary campaign — to create a "deportation force" that would remove all of the estimated 11 million immigrants living in the country illegally.

Trump instead repeated the standard Republican talking point that only after securing the border can a discussion begin to take place about all such immigrants, ducking the major question that has frustrated past congressional attempts at remaking the nation's immigration laws.

That omission didn't bother Dan Stein, who leads the Federation for American Immigration Reform, a group that pushes for stricter immigration policies. He called Trump's speech the outline of "a coherent and workable strategy."

"But even more important than the details of the plan itself," Stein said, "Trump laid out the most fundamental principle for true immigration reform: The policy exists to protect and serve 'the well-being of the American people,' and 'protect all aspects of American life.'"

Critics, meanwhile, said Trump's glossing over the fate of people who are peacefully living in the U.S. without permission doesn't make up for his overall approach.

"It is still the most extreme position of any modern presidential candidate," said Frank Sharry, a leading immigration advocate. "It is deeply unpopular with voters, and profoundly un-American."

Even as he beat a retreat from his earlier pledge to deport all illegal immigrants from the country, Trump's aggressive tone in Phoenix marked a shift from earlier in the day. A much more measured Trump described Mexicans as "amazing people" as he appeared alongside Pena Nieto in Mexico's capital city.

The good feelings from his first meeting with a head of state as his party's presidential nominee lasted only a short time, as a dispute arose in the hours after he left Mexico City over the most contentious part of the billionaire's plans to fight illegal immigration — his insistence that Mexico must pay to build a physical wall along the roughly 2,000-mile U.S. southern border.

Trump told reporters during his afternoon appearance with Pena Nieto that the two men didn't discuss who would pay for a cost of construction pegged in the billions. Silent at that moment, Pena Nieto later tweeted, "I made it clear that Mexico will not pay for the wall."

With the meeting held behind closed doors, it was impossible to know who was telling the truth.

Trump told the rowdy Arizona crowd that he respects the Mexican president. "We agreed on the importance of ending the illegal flow of drugs, cash, guns and people across our border and to put the cartels out of business," he said.

Yet, standing on American soil, he addressed directly a question he sidestepped when asked in Mexico.

"Mexico will pay for the wall, 100 percent," the New York businessman said. "They don't know it yet, but they're going to pay for the wall."

The Mexican president, however, said on Twitter that the subject was among the first things the men discussed. "From there, the conversation addressed other issues, and developed in a respectful manner," Pena Nieto wrote.

Trump was cheered in Arizona, but his appearance in Mexico sparked anger and protests. The candidate is deeply unpopular in Mexico due in large part to his deriding the country as a source of rapists and criminals as he kicked off his campaign. He piled on in the months to come, attacked the country over free trade, illegal immigration and border security.

Campaigning in Ohio, Democrat Hillary Clinton jabbed at Trump's Mexican appearance as she promoted her own experience working with foreign leaders as the nation's chief diplomat.

"People have to get to know that they can count on you, that you won't say one thing one day and something totally different the next," she told the American Legion in Cincinnati.

Associated Press writers Erica Werner in Washington, and Mark Stevenson and Maria Verza in Mexico City, contributed to this report.