The Mexican government has made its first direct response to Donald Trump’s pledge to build a wall along the two countries’ border and make Mexico pay for it.

“I say it emphatically and categorically: Mexico, under no circumstance is going to pay for the wall that Mr Trump is proposing,” the Mexican treasury secretary, Luis Videgaray, said late on Wednesday to Milenio television.

The wall proposal by the Republican presidential hopeful has been criticized widely and fiercely in Mexico, but the government itself has tried to avoid commenting directly on the issue until now.

Trump is leading the Republican presidential contenders and has used especially tough talk on immigration.

His comments came one day after Francisco Guzmán of President Enrique Peña Nieto’s office told reporters that the government would not engage in verbal duels with US candidates. Instead, he described a plan to reach out with information to campaigns through Mexican consulates in the US.

Former Mexican presidents Vicente Fox and Felipe Calderón had already derided the idea and compared Trump to Adolf Hitler.

“Building a wall between Mexico and the United States is a very bad idea, it is an idea based in ignorance and that is not supported by the reality of North American integration,” Videgaray said. He said there was no way that Mexican taxpayers could pay for that sort of project.

Since he launched his campaign last summer, Trump has taken aim at Mexicans, saying they bring crime and drugs to the US and are “rapists”.

Mexico’s answer until now had been to remind Americans of the economic contributions made by their citizens and Mexican-Americans. The two countries’ trade amounts to more than $500bn annually.