Republican presidential nominee DonaldTrumpvowed on Wednesday that anyone who is in the United States illegally would be subject to deportation if he is elected, stressing his hardline position after flirting with a softer approach.


In a major speech in the border state of Arizona,Trumptook a dim view of the 11 million people who crossed into the United States illegally, a week after saying many were "great people" who had contributed to American society.


He said immigrants would have to return home and re-apply for re-entry.


"Our message to the world will be this: You cannot obtain legal status or become a citizen of the United States by illegally entering our country,"Trumpsaid.


"People will know you can't just smuggle in, hunker down and wait to be legalized," he said.


Trumpagain vowed that Mexico would pay for construction of a "great border wall" between the two countries. He spoke hours after Mexican President Enrique Pena Nieto toldTrumpin a face-to-face meeting in Mexico City that Mexico would not pay for it.

RELATED:Naked Donald Trump statue up for auction, could fetch $20,000

"We will build a great wall along the southern border,"Trumpsaid. "And Mexico will pay for the wall - 100 percent. They don't know it yet, but they're going to pay for the wall."

Trumpsaid at a joint news conference with Pena Nieto that he and the Mexican leader did not discuss who would pay for the wall. Pena Nieto remained silent on the issue at the event, but then said on Twitter he did raise the issue.

"At the beginning of the conversation with DonaldTrumpI made it clear that Mexico will not pay for the wall," Pena Nieto said in a tweet.

RELATED:Trump told Mexico won't pay for wall

In his speech,Trumpemphasized that his priority in cracking down on the undocumented population in the United States would be to quickly deport those who have committed serious crimes.

He said he would form a commission to study which regions or countries he would suspend immigration from, saying Syria and Libya would be high on his list. This is his way of carrying out his proposed ban on Muslims from some countries without getting into their religious affiliation.

Trumpsaid he would also establish a "deportation task force" to identify criminals subject to deportation and would triple the number of border patrol agents.

Trumpis trailing Democratic rival Hillary Clinton in opinion polls for the Nov. 8 election. The New York businessman's aides hoped the trip would make him look presidential and show he was willing to deal head-on with a thorny issue like relations with Mexico.