ROME — Italy resisted the entreaties and warnings of its European Union and American allies on Saturday by officially joining China’s vast new Silk Road at a signing ceremony with President Xi Jinping of China, a move that crystallized shifting geopolitical balances and the populist Italian government’s willingness to break with its traditional partners.

The agreement will “build a better relationship” between China and Italy, Prime Minister Giuseppe Conte of Italy said.

Italy became the first of the Group of 7 nations that once dominated the global economy to take part in China’s “One Belt One Road” project, which makes enormous infrastructure investments to move Chinese goods and resources throughout Asia, Africa and Europe.

The Trump administration, which tried and failed to stop the deal, focused in the days leading up to Mr. Xi’s visit on blocking any Italian use of 5G wireless networks developed by the Chinese electronics giant Huawei, which Washington warned could be used by Beijing to spy on communications networks.