Japanese media reported on Monday that Prime Minister Abe Shinzo intervened to convince Salvadoran President Nayib Bukele not to give control of a key port in the country to the Chinese Communist Party.

Bukele completed a tour of the Far and Middle East late this year that included stops in both Beijing and Tokyo. In Beijing, Bukele announced that he had convinced dictator Xi Jinping to invest millions in infrastructure in El Salvador meant to promote tourism and encourage Salvadorans not to emigrate. El Salvador established diplomatic ties with China and abandoned the sovereign nation of Taiwan during the term of Bukele’s leftist predecessor, Salvador Sánchez Cerén. Bukele, a formerly leftist populist, took over the presidency of his nation this year after promising to use money he would prevent from being lost to corruption to instead build up the nation’s infrastructure.

Bukele has also promised the United States he would not seek further investment from Washington given how much America has contributed to attempting to help El Salvador build up. His tour of Asia was largely an attempt to attract other sources of development

According to Japan’s Kyodo News, Bukele made similar attempts in Japan to get the Japanese government to invest in El Salvador as he did in China. Abe’s administration, however, reportedly threatened to withdraw investment if Bukele went too far in giving China power over the country’s ports.

According to Kyodo’s source, Tokyo “warned of withdrawing its plan to provide 11.2 billion yen ($102 million) in official development assistance after Washington took issue with” a Chinese corporation considering buying a port in El Salvador. The port in question would have received Japanese funding to be built.

Bukele reportedly agreed to the terms, telling Japanese officials “that El Salvador would not allow China to get involved in running important infrastructure.”

Upon returning from the world tour, which also included a stop in Qatar, Salvadoran news agencies reported that Bukele agreed to support Japan in its attempts to control the threat arising from North Korea in exchange for strengthening economic ties to Tokyo, including investment in a new highway bypass in the city of San Miguel. Bukele’s was the first visit to Tokyo by a Salvadoran president in 13 years; the countries have maintained official ties for 80 years.

China launched its Belt and Road Initiative (BRI) in 2017, a plan to invest heavily in the development of infrastructure throughout the world’s impoverished nations. The original plan, as Xi Jinping presented it, would be to invest in major ports, roads, and railways to reconstruct the ancient Silk Road, connecting Beijing to Western Europe. The plan rapidly expanded to include countries far from that trajectory, however, including Kenya, Djibouti, Rwanda, Cuba, and islands in Oceania. The plan also began including non-civilian projects like China’s first overseas military base in Djibouti.

The U.S. State Department has for years warned that joining BRI projects creates “debt traps” in which a country agrees to a loan from China to import Chinese workers to build a project — a railway, for example — with the promise that the project will generate the revenue to pay back the loan and the project will create jobs. The result, particularly in Africa, has been that China imports Chinese workers and pays them significantly more than locals, who are segregated and racially discriminated against. The Chinese send the money back to China. The railway, once constructed, does not make enough money to pay the loan back, and China takes possession of land assets to make up for the country’s inability to pay.

Bukele returned from Beijing in December touting a “gigantic” investment from China and claiming he had not fallen into the BRI trap because the money China would invest was not a loan.

“I see some detractors trying to attack the gigantic cooperation deal we achieved with China, alleging that it is a ‘debt trap,’” Bukele wrote on Twitter. “What part of ‘non-refundable’ did you all not understand? It is not a loan, it is a donation. And all construction projects will be the property of El Salvador.”

Among the projects China agreed to build are a new national library, a sports stadium, the reconstruction of nearly the entire surf tourism region of the country, and a new water system.

Bukele boasted that the Chinese investment allows El Salvador to rely less on American donations, which helps President Donald Trump cut foreign spending and improves relations with Washington. During Bukele’s visit to Washington in July, he insisted he did not want “more blank checks” from the United States. He also promised increased cooperation to fight the Mara Salvatrucha (MS-13) gang, which has established itself in some parts of the United States and urged Salvadorans to stay in and invest in their country in the face of a growing migration wave north.

Follow Frances Martel on Facebook and Twitter.