LONDON — The British government Tuesday handed the U.S. government a major defeat in its months-long campaign against the Chinese tech giant Huawei by agreeing to use Huawei equipment in part of its telecommunications network.

The decision marked a rare split between the transatlantic allies and a blow to Washington as it battles China for dominance over the installation of the new communications technology known as 5G.

The United States has put Huawei at the forefront of that battle, arguing that installing the company's telecommunications equip­­ment would leave allied countries vulnerable to Chinese espionage.

China critics in the United States quickly panned the announcement and warned that it could damage U.S.-British trade relations.

“This decision has the potential to jeopardize US-UK intelligence sharing agreements and could greatly complicate a US-UK free trade agreement. I hope the British government will reconsider its decision,” Sen. Lindsey O. Graham (R-S.C.) wrote in a tweet.

“America has never been weaker. We have never had less influence. Not even our closest ally Britain, with a Trump soulmate in Downing Street, listens to us anymore,” Sen. Chris Murphy (D-Conn.) wrote on Twitter.

British officials portrayed those reactions as overwrought. They noted that the decision limits Huawei’s market share of Britain’s “non-core” 5G network to 35 percent, labels the company a “high risk” vendor and bars the use of its equipment in “core” parts of the network, including intelligence, military and nuclear sites.

“We have looked at the issue of how to maintain network security and resilience over many months and in great technical detail,” Foreign Secretary Dominic Raab said. “We would never take decisions that threaten our national security or the security of our Five Eyes partners,” a reference to the intelligence-sharing consortium that includes Britain, the United States, Australia, Canada and New Zealand.

Other British government officials scoffed at suggestions that Washington might reduce intelligence-sharing with its key ally because of security concerns with Huawei in the 5G network.

“There is absolutely no reason” for the United States to lessen intelligence-sharing “because this [decision] upholds the security of our 5G network,” said one official, who spoke on the condition of anonymity to discuss intelligence matters, adding that intelligence is exchanged on separate, highly secure systems. “So there is absolutely no reason why intelligence-sharing should be called into question by this decision.”

Still, the British decision shows the challenges the Trump administration faces as it asks countries to pick a side in the battle over Huawei. Germany, Brazil and other nations are still deciding how and whether to use Huawei equipment in the super-fast 5G wireless networks they are building.

“I worry the U.K. decision could potentially be a preview of other decisions around the world,” said Kelly Magsamen, a former Pentagon official who also served on the National Security Council during the Obama and George W. Bush administrations.

Sen. Mark R. Warner (D-Va.), a former communications executive, suggested in a statement that the decision shows the need for the United States and its allies to work together “to build more diverse and secure telecommunication options.” Currently, Huawei is the world’s leading provider of 5G equipment. The other major providers are Finland’s Nokia and Sweden’s Ericsson. There are no major U.S.-based providers.

Prime Minister Boris Johnson chaired the meeting of Britain’s National Security Council where the plan was approved. The British government will now seek to legislate the proposals through Parliament. It is possible that the House of Commons could amend Johnson’s plan — loosening or strengthening Huawei’s hand. But after a landslide win in last month’s general election for Johnson and his Conservative Party, the government can count on parliamentary approval for most of its proposals.

Huawei, which has dismissed U.S. security concerns as unfounded, described Britain’s announcement Tuesday as a win.

“This evidence-based decision will result in a more advanced, more secure and more cost-effective telecoms infrastructure that is fit for the future. It gives the U.K. access to world-leading technology and ensures a competitive market,” Huawei Vice President Victor Zhang said in a statement.

In a telephone call after the decision was announced, Trump and Johnson “underlined the importance of like-minded countries working together to diversify the market and break the dominance of a small number of companies,” a Downing Street spokesman said by email.

The British decision follows months of pressure from U.S. officials. Secretary of State Mike Pompeo tweeted Sunday that Britain had a “momentous decision ahead on 5G.” On Friday, Trump himself called Johnson to talk about Huawei.

And in meetings in London this month, top national security and State Department officials warned that the United States would have to reassess whether Britain could sufficiently protect shared intelligence if it let Huawei into its 5G network. The British press quoted the officials saying that using Huawei gear would be “nothing short of madness.”

Major U.K. telecommunications companies such as British Telecom already use Huawei gear in their 3G and 4G networks, and Britain does not want to fall behind in the 5G world.

“The British public deserve to have access to the best possible technology,” Johnson said in a BBC interview this month. “On the other hand, let’s be clear. I don’t want, as the U.K. prime minister, to put in any infrastructure that is going to prejudice our national security or our ability to cooperate with Five Eyes intelligence partners.”

Foreign Minister Raab said the lack of a wide choice of providers played a part in the decision. “Currently, the U.K. faces a choice of only three major players to supply key parts of our telecoms networks,” he said. “It is a market failure that must be addressed,” he said, adding that Britain planned to support new technology that could help diversify the market.

“It is essential that we are never again in a position of having such limited choices when deploying such important new technologies,” Raab said.

The coming super-fast 5G networks are expected to power the “Internet of Things,” enabling industrial, transport and everyday devices to be connected, to “talk” to one another and to share data constantly, powering future technologies such as driverless cars and smart household appliances.

Supporters say 5G may usher in a “fourth industrial revolution.” Critics worry that the systems will allow for widespread spying, data harvesting and loss of privacy.

The United States has taken several steps to try to isolate Huawei. Last year it banned the sale of some U.S. technology to Huawei. It has also blocked the company from installing telecom equipment in the United States.

Japan and Australia effectively also have banned Huawei from their 5G networks.

A group of Republican lawmakers this month introduced legislation that would bar U.S. intelligence-sharing with any country that allows Huawei into its 5G network. Although it is not expected to pass — at least not in its current form — the threat sends a signal that Congress does not intend to sit on the sidelines on the issue.

Last summer, Parliament’s Science and Technology Committee said Britain should ban Huawei from the most sensitive operations of its 5G network. It said it saw no technical grounds for completely excluding the company’s gear, although it added that there could be “geopolitical or ethical grounds for the government to decide to enact a ban.”

Britain had long signaled that it intended to bar Huawei from government systems and “core” networks that contain routers and switches handling massive volumes of traffic, while allowing the Chinese equipment-maker into the “edge,” where radio antennae connect with user devices.

U.S. officials have argued that even a limited presence is too much in a 5G network, saying the distinction between core and edge is virtually meaningless because so much more data can be processed at the network periphery.

British lawmakers, industry lobbyists and privacy activists are themselves divided. Intelligence officials last year delivered a scathing assessment of the security risks posed by Huawei in telecom networks, saying they found “significant technical issues” in the firm’s engineering processes as well as “concerning issues” in its software.

British officials and lawmakers wrestled with the decision for more than a year, with some signaling skepticism about a full ban. In a June speech, the head of Britain’s National Cyber Security Center, Ciaran Martin, said the country needed to consider a broad range of threats.

“The most significant attack on U.K. [telecommunications] in recent years that we know of was Russian, and we don’t have any Russian-owned or -flagged kit in our [telecommunications] networks,” he said.

In Brussels, European Union policymakers are set to unveil draft guidelines Wednesday that would give E.U. countries the tools to exclude Huawei from their networks if they choose to do so. But the E.U. lacks the ability to ban the Chinese company across the bloc. Instead, individual capitals make the decisions, giving Beijing greater leverage to pressure countries.

German Chancellor Angela Merkel has publicly rejected the idea of banning any company “simply because it’s from a certain country,” and she is seen as reluctant to alienate either China or the United States, two large buyers of German cars and machinery. But German intelligence officials and some members of Merkel’s party have pushed for a tougher stance against Huawei, sparking a fiery debate that has delayed a final decision.

Germany’s Foreign Office, Interior Ministry and intelligence services “all emphasize the risks of Huawei,” while “the Federal Chancellery and Ministry for Economic Affairs are against a ban,” researchers with the German Council on Foreign Relations wrote in a recent report.

In December, China’s ambassador to Berlin, Ken Wu, warned that there could be “consequences” for Germany if it excluded Huawei. Speaking at a forum hosted by the newspaper Handelsblatt, Wu noted that Germany sells millions of cars a year in China, the world’s largest auto market.

“Could we say one day that the German cars are not safe because we are able to manufacture our own cars?” he said. “No. That is pure protectionism.”

Nakashima and Whalen reported from Washington. Michael Birnbaum in Brussels contributed to this report.