"I will say it emphatically: There is no scenario in which Mexico will pay for this wall that is being proposed by the United States presidential hopeful," Mexican Treasury Secretary Luis Videgaray told Mexican broadcaster Milenio TV.

Videgaray cited two reasons in the interview, which aired Wednesday night.

The first, he said, is that public money should be used to benefit the Mexican people.

"We have enormous necessities and much more important uses for the public budget, which comes from the taxes that Mexicans pay," he said. "And, of course, it would never be used in any scenario to pay for a project of this nature."

Read More

Secondly, he said, it just doesn't make sense.

"To build a wall between Mexico and the United States is a terrible idea. It is an idea that is based on ignorance, that has no basis in the reality of North American integration," he said.

Beefing up the border wall and cracking down on illegal immigration have become pillars of Trump's campaign platform. The presidential hopeful has maintained that Mexico will pay for a new wall and estimated the price would be $8 billion.

This isn't the first time Trump's border wall proposal has drawn the ire of officials south of the border. But Videgaray's comments mark the first direct response from President Enrique Peña Nieto's government.

Two ex-presidents -- Vicente Fox and Felipe Calderon -- have slammed the idea.

Calderon had a similar take when he spoke with CNBC about the proposal last month.

"Mexican people, we are not going to pay any single cent for such a stupid wall, and they need to know that," Calderon said. "And it's going to be completely useless."

Videgaray told Milenio that there's a larger number of Americans traveling to Mexico than Mexicans immigrating to the United States. He stressed the important trade relationship between the two countries and said that rather than building bigger walls, the neighboring nations should be building better bridges.