Former Mexican President Vicente Fox agreed Wednesday night with Fox News host Megyn Kelly that the U.S. and Mexico could work together on an effective border fence.

Fox told Kelly that he believes the countries could partner to install a secure barrier on the 2,000-mile southern border. The Mexican politician said both countries could benefit from less cartel activity and human trafficking.

"Yes ... I am with you. I'm not for open borders," Fox said.

The response was Fox's most welcoming yet after GOP presidential front-runner Donald Trump said he would make Mexico pay for the wall because of how the country has hurt the U.S. in trade deals.

Fox repeatedly said he would prefer Congress pass comprehensive immigration reform and legalize millions of immigrants before approving the border fence.

Kelly responded to Fox by telling him voters have made it clear this election season that border security must come before any other immigration actions.