Postmaster General Megan Brennan is set to step down, and her successor will face the daunting task of turning around the U.S. Postal Service’s finances.

But the task became a little easier last month when President Trump’s top trade negotiator forced the body that regulates international postage rates to agree to a U.S. proposal that could save hundreds of millions of dollars per year for the Postal Service.

It was billed as a “test of the Trump administration’s diplomatic clout,” and when it was over, not only had the administration demonstrated its clout but it had also dealt a blow to China’s dominance of the postal package market.

On September 25, the Universal Postal Union (UPU), a UN organization that sets rates and rules for international mail among 192 countries, agreed to U.S. demands to reform the fee structure so that importing countries, such as the U.S., and by extension the U.S. Postal Service, could begin to stop the bleeding of losses from distributing mail and packages from countries including China.

The UPU sets rates countries pay each other for handling each other’s international mail. If you mail something to New Zealand from the U.S., for example, the U.S. Postal Service would collect your postage, then send some of it to the New Zealand postal service to cover its costs of delivering the package.

China had been considered a developing country when the current rate framework was set, meaning it received reimbursement at rates as generous as those afforded the world’s poorest countries. But it has since become a world leader in shipping consumer goods. Because of these rate advantages, it was in some cases less expensive to ship an item from China to the U.S. than from one location in the U.S. to another.

The union sets the amounts each country can charge, and rates are set every four years. Under the terms of recent four-year agreements, letter traffic has declined in recent years and package shipping has grown tremendously, which further complicated things because of changing equipment needs and other factors.

The Trump administration had threatened to pull out of the UPU unless its members agreed to reforms that would help fix the discriminatory imbalances. Delegates voted down a Trump administration proposal on the first day of the UPU’s “extraordinary congress” — only the third such meeting since 1874.

But the next day, after Bishar Hussein of Kenya, head of the 192-member union, reminded attendees that the U.S. moves 40 percent of the world’s mail, that it has for decades offered sweetheart deals to help developing countries’ postal systems, and that a U.S. walkout would “completely shut down” the traditional system of delivering bulky letters, a slightly watered-down version of the U.S. proposal passed without opposition.

Under the agreement, high-volume importers of mail and packages can soon impose self-declared rates for distributing foreign mail. Countries with more than 75,000 tons of post imported annually — a category that includes only the U.S. — can apply their self-declared new rates starting next July.

Peter Navarro, the White House trade adviser, said the Postal Service, which expects to lose $6 billion this year, could save $300 million to $500 million by not subsidizing the cost of delivering imports from China.

“We’ll buy less Chinese stuff, buy more from other countries, we will make more in America and the market will be free of distortions,” Navarro said at a news conference in Geneva after the vote. “China is certainly going to pay more for the privilege of shipping to our market.”

Small business group leaders hailed what they called a breakthrough in removing what had been a huge competitive disadvantage for many of them.

“The final reform package is a tremendous victory for the U.S. and America’s small business community.” said Karen Kerrigan, president and CEO of the Small Business & Entrepreneurship Council. “The Trump administration and the State Department deserve high praise for their work to reform the long-standing imbalances in international rates that put U.S. small businesses and entrepreneurs at a major competitive disadvantage.”