MEXICO CITY — A deep rift opened Thursday between the United States and its southern neighbor as the Trump administration pressed forward with a plan for a giant border wall and insisted that Mexico would pay for it, possibly through a U.S. tax on imports.

President Enrique Pena Nieto on Thursday called off a trip to Washington after restating that Mexico would not finance the wall. Hours later, President Donald Trump's spokesman, Sean Spicer, said the wall could be funded by a 20 percent import tax on goods from Mexico.

The plan for a border wall was a centerpiece of Trump's election campaign, though he never specified how Mexico would fund the project or how he would compel payments if Pena Nieto's government refused.

The two leaders had been scheduled to discuss the matter at the White House next week. But Pena Nieto took to Twitter on Thursday to say he had informed the White House he would not be coming.

In a speech in Philadelphia later Thursday, Trump cast the cancellation as a mutual decision. He said that “unless Mexico is going to treat the United States fairly, with respect, such a meeting would be fruitless, and I want to go a different route. We have no choice.”

At that speech in Philadelphia, during a party retreat, Trump called on fellow Republicans to help him enact “great and lasting change” but offered the lawmakers few details about his views on key issues including tax reform and health care.

The president was greeted by cheers as he took the stage in a hotel ballroom, telling senators and House members, “This Congress is going to be the busiest Congress in decades — maybe ever.”

The president spoke about his agenda in broad terms and then skipped a planned question-and-answer session. He gave Republicans no specific marching orders for tackling the repeal and replace of the Affordable Care Act, one of the most complicated issues Congress is expected to tackle this year.

On the flight back to Washington, Trump's spokesman told reporters the president was considering the 20 percent import tax to foot the bill, the most specific proposal Trump has ever floated for how to cover a project estimated to cost between $12 billion and $15 billion.

“By doing that, we can do $10 billion a year and easily pay for the wall just through that mechanism alone,” Spicer said. “This is something that we've been in close contact with both houses in moving forward and creating a plan.”

Spicer said Trump was looking at taxing imports on all countries the U.S. has trade deficits with, but he added, “Right now we are focused on Mexico.”

But the announcement sparked immediate confusion across Washington, and the White House tried to backtrack. During a hastily arranged briefing in the West Wing, chief of staff Reince Priebus said a 20 percent import tax was one idea in “a buffet of options” to pay for the border wall.

A 20 percent tariff would represent a huge tax increase on imports to the U.S., raising the likelihood of costs being passed on to consumers. Half of all non-agricultural goods enter the U.S. duty-free, according to the office of the U.S. Trade Representative. The other half face import tariffs averaging 2 percent.

House GOP lawmakers and aides interpreted Spicer's comments on a 20 percent border tax as an endorsement of a key plank of their own tax plan, which Speaker Paul Ryan has been working to sell to the president. The House GOP “border adjustability” approach would tax imports and exempt exports as a way of trying to help U.S. exporters and raise revenue.

Earlier this month, Trump called that concept confusing. And during the White House's cleanup efforts Thursday, Spicer wouldn't say whether Trump agreed with the border adjustment tax being considered by the House GOP.

There is disagreement within the new administration over the effectiveness of tariffs in general. Wilbur Ross, Trump's nominee for commerce secretary, dismissed tariffs for trade negotiations during his confirmation hearing, saying the 1930 Tariff Act “didn't work very well then and it very likely wouldn't work now.”

Also Thursday, the man charged with protecting America's borders was ousted. Border Patrol Chief Mark Morgan said he was asked to leave and decided to resign rather than fight the request, according to a U.S. official who was on a brief video conference in which Morgan informed senior agents of the change. The official spoke on condition of anonymity because the discussion was not intended to be made public.

Pena Nieto had been scheduled to meet with Trump on Tuesday to discuss immigration, trade and drug-war cooperation. He called off the visit after Trump tweeted that it would be “better to cancel the upcoming meeting” if Mexico was unwilling to pay for the wall.

Pena Nieto has faced intense pressure at home over his response to Trump's aggressive stance toward his country. Until this week, Mexico had tried its traditional approach of quiet, cautious diplomacy combined with back-room discussions, sending Cabinet officials for talks with the Trump administration.

Both Pena Nieto and Spicer said their countries were interested in maintaining positive relations.

“We will keep the lines of communication open,” Spicer told reporters in Washington on Thursday morning, adding that the White House would “look for a date to schedule something in the future.”

The Mexican president tweeted that his government was willing to work with the United States “to reach agreements that benefit both nations.”

But Mexicans expressed shock and dismay as Trump moved to turn his campaign promises into reality.

Mexicans view a wall across the 2,000-mile border as a symbolic affront, part of a package of Trump policies that could cause the country serious economic pain. They include a crackdown on illegal immigrants, who send billions of dollars home, and renegotiation of the North American Free Trade Agreement, or NAFTA.

The treaty has allowed trade between the neighbors to mushroom. Every day, goods valued at $1.4 billion cross the U.S.-Mexico border, and millions of jobs are linked to trade on both sides. Mexico is the world's second-largest customer for American-made products, and 80 percent of Mexican exports — automobiles, flat-screen TVs, avocados — are sold to the United States.

In Mexico, politicians and analysts railed against Trump's plans for the wall and a major crackdown on immigration, as well as a renegotiation of NAFTA.

“When we are talking about building a wall, about deporting migrants, about eliminating sanctuary cities [for migrants], about threatening to end a free-trade agreement, or to take away factories, we are really talking about causing human suffering,” Margarita Zavala, a possible candidate for the presidency in 2018 and the wife of former president Felipe Calderon, said in an interview.

“And after today, without a doubt, it is very difficult to negotiate from behind a wall.”

“Never,” former President Vicente Fox said in an interview, when asked if Mexico had faced a comparable U.S. president in his lifetime.

“And I never thought the U.S. people would go for a president like this.”

The Washington Post and the Associated Press contributed to this article.