Donald J. Trump is heading to Mexico on Wednesday to meet with President Enrique Peña Nieto, but one of the Mexican leader’s predecessors had a different message for the Republican presidential nominee: You are not welcome here.

Vicente Fox, Mexico’s president from 2000 to 2006, said on Wednesday that the invitation from Mr. Peña Nieto was a mistake and that Mr. Trump should never be trusted in the country because of the way he has demonized its people.

“He is not welcome to Mexico,” Mr. Fox told CNN. “We don’t want him. We reject his visit.”

Mr. Fox has been critical of Mr. Trump’s plan to build a wall on the border between the United States and Mexico and on Wednesday he shrugged off recent signs of Mr. Trump softening his plans to deport 11 million undocumented immigrants.

“You cannot trust a guy like this,” Mr. Fox said. “How can we grant confidence and support to ideas that change everyday? He cynically continues to disregard his own people and disregard Mexicans.”