Five years ago, Hillary Clinton reached one of the least-noticed diplomatic agreements of her tenure as secretary of State — a deal obligating Japan to continue paying nearly $2 billion a year to help defray the cost of U.S. troops stationed on its territory.
The money is used to build housing and training areas for U.S. forces, pay wages to thousands of Japanese workers on U.S bases and supply water and power.
The payments, which began in 1978 and are considered a pillar of the post-war U.S.-Japanese alliance, cover about a third or more of the cost of keeping 49,000 U.S. troops in Japan.
The five-year extension was disclosed in a dry communique after closed-door talks in June 2011 between Clinton and Japanese officials at the State Department. Clinton didn't announce the deal, but the payments were never a secret.
Despite that history, Republican presidential nominee Donald Trump has insisted repeatedly that Japan and other U.S. allies contribute little or nothing to the United States for their own defense.
"They do not pay us. But they should be paying us, because we are providing tremendous service and we're losing a fortune," Trump said Monday in a debate with Clinton, the Democratic nominee, at Hofstra University in New York.
The Pentagon spends an estimated $10 billion a year on overseas bases. More than 70% of the total is spent in Japan, Germany and South Korea, where most U.S. troops abroad are permanently stationed.
In return, the Pentagon receives various forms of compensation from the host countries, from rent-free real estate where the bases are located to actual cash payments meant to offset U.S. costs.
Trump's attacks on allies as freeloaders is core to his political message that the U.S. is being outmaneuvered by both friends and adversaries overseas.
National security experts say his false claims on defense issues could undermine the network of military and diplomatic alliances constructed around the globe by U.S. presidents of both parties over the last 70 years.
"Can we drive a better bargain in some cases? Yeah, and [U.S. officials] are always negotiating" for better terms, said Barry Pavel, a former Pentagon official who now is vice president of the Atlantic Council, a Washington think tank that supports NATO and other U.S. alliances.
"But we gain the most out of these alliances because it helps keep threats much farther from our shores than they otherwise would be," he added.
In Asia, said Zach Cooper, a security expert at the Center for Strategic and International Studies, a nonpartisan Washington think tank, Trump's suggestion on the campaign trail that he might withdraw U.S. troops or fail to come to the aid of allies in a crisis is generating unease among allies.
"Japan and South Korea already pay large amounts to host U.S. forces on their soil," he said. "Trump's comments make it more likely that competitors will escalate crises into conflicts, and that U.S. allies will develop their own independent defensive capabilities, which could increase the danger of nuclear proliferation in Asia and elsewhere."
It's difficult to make exact comparisons of "host nation support," as the Pentagon calls contributions from allies, because assistance comes in different forms and the Pentagon doesn't provide an accounting. An annual Defense Department report tallying foreign contributions was halted in 2004.
Especially opaque are contributions from allies in the Middle East. The Pentagon maintains large permanent bases in the United Arab Emirates, Bahrain, Qatar and Kuwait, but those countries keep details of their military relations with the U.S. shielded from public view.
In Germany, where the United States maintains 38,000 troops and dozens of bases, compensation from Berlin is largely indirect. It includes tax waivers and rent-free use of facilities as well as construction of roads and other infrastructure in communities where installations are located.
Japan has been one of the most generous hosts of U.S. forces, although its willingness to pay has waned lately.
Tokyo's payments grew steadily for the first 20 years of the funding agreements, peaking at more than $2.5 billion a year in 2000.
But the support has dropped in the last decade due to budget pressures in Tokyo and domestic opposition in Japan to the U.S. military presence, especially on the island of Okinawa, home to more than half the U.S. troops in Japan.
Japan has agreed to pay as much as $12 billion to build a new U.S. base on Okinawa for thousands of Marines now at the U.S. installation in the town of Futenma. But that project has been repeatedly delayed by local opposition.
Those pressures would make it difficult for Trump to fulfill his vow to force Japan to pay more money, experts say.
Under the 2011 agreement, Tokyo agreed to continue paying just under $2 billion a year. But the deal also called for a "phased reduction" in Japan's contribution to utilities and workers' salaries on U.S. bases.
The 1953 U.S.-South Korea defense treaty allowed the Pentagon to station troops there. But with the country devastated by war, the U.S. paid the bills.
In 1966, Seoul agreed to provide "all facilities" to the U.S. military at no cost, with the Pentagon picking up "all expenditures" for keeping troops there.
But in 1991, after the South Korean economy had grown into one of the world's largest, Seoul agreed to start picking up more of the expenses of the U.S. military presence.
The most recent agreement, signed in 2014, increased South Korea's contribution to more than $800 million a year. That's equal to about half the annual cost of the 28,500 U.S. troops stationed there, according to Pentagon officials, not including personnel costs that the Defense Department would have to pay no matter where the troops were posted.
The money doesn't go to Washington, however.
It's used to pay salaries of Koreans working on U.S. bases or is in the form of non-cash contributions of services and construction at the installations, according to Army Gen. Vincent Brooks, the commander of U.S. troops in Korea.
South Korea also is funding most of a $10.8-billion construction project that will allow U.S. troops to move from bases near Seoul and the Demilitarized Zone along the border with North Korea to new installations farther south.