GENEVA — The United States agreed on Wednesday to stay in a United Nations body that has regulated international mail service for more than a century after delegates agreed during emergency talks to change the way postal fees are structured.

The Trump administration had threatened to leave the body, the Universal Postal Union, after Oct. 17 if its members did not change the system of fees that postal services charge for collection and delivery of international mail and small parcels.

The administration’s primary concern has been the sliding scale of fees that allowed China, the world’s second-largest economy, to take advantage of lower rates that are available to developing countries. As a result, manufacturers in countries like China and Cambodia have been able to pay far less to send a small package to the United States than what it costs American businesses to ship one from Los Angeles to New York.

The deal struck on Wednesday will allow the United States to start setting its own postal fees in July and allow other countries that receive more than 75,000 metric tons of mail a year to start phasing in higher rates in January 2021.