The shock felt in Washington at what Hillary Clinton called the “assassination” of British MP Jo Cox has coincided with a belated American realisation of just how febrile UK politics has become ahead of next Thursday’s vote on leaving the European Union.

While the US has been mourning victims of the Orlando shooting and digesting new extremes of anti-immigrant rhetoric from Donald Trump in response, the extent to which the European migration debate has driven the UK to brink of “Brexit” had gone less noticed.

“The recent [pro-Brexit] opinion polling is only just beginning to sink in here,” says one senior European diplomat trying, behind the scenes, to reassure Washington’s increasingly nervous foreign policy community about the future of the Atlantic alliance.

White House intervention has so far focused on spelling out the cost of leaving the EU to British voters. Barack Obama hoped his trip to London last month – in which he described how the UK would be “at the back of the queue” for trade negotiations if it left – would help the prime minister, David Cameron, scare voters into staying put.

But despite similar dire warnings again this Friday from the International Monetary Fund head, Christine Lagarde, the steady swing of British opinion polling is in favour of Brexit. This is raising concerns that it is not just the UK that stands to lose out; that US foreign policy would also suffer greatly from a subsequently weakened Europe.

“Among the foreign policy elites there’s a consensus that the special relationship with Britain would become less special from the United States’ perspective if Britain isn’t influencing Europe,” says Fred Kempe, president of the Atlantic Council, a prominent Washington thinktank. “No doubt there is still going to be a great military relationship and trade etc, but in terms of solving global problems together it’s far better [for the US] to have Britain in.”

“Both the US and Europe view the UK as a transatlantic bridge,” added the Washington-based EU diplomat. “There is no European country that understands the US better than Britain, and no better explainer of the American view to Europe.”

There is also sympathy for the predicament that the UK find itself in. “There is an understanding that the European Union is a flawed place,” says Kempe. “But there is also a feeling that it would become more flawed without Britain in.”

One senior Japanese diplomat in Washington confided privately that while his government was bemoaning the impact of Brexit on Japan’s European-exporting car factories in Britain, he personally could understand the desire to reassert national sovereignty.

Among US politicians too, Brexit has become a somewhat partisan issue. While Democrats and many establishment Republicans share in collective angst over the security consequences of the UK leaving the EU, conservatives in the GOP have been far more sympathetic.

In a March interview, Republican presidential candidate Rand Paul argued that the United Kingdom should never have joined the EU. Ted Cruz has been agnostic on the subject, while condemning Obama’s visit to the UK to campaign against Brexit.

Most noticeably, presumptive Republican nominee Donald Trump has explicitly come out in support of UK withdrawal from the EU, linking British membership to “migration”.

“I think the migration has been a horrible thing for Europe,” Trump told Fox News in May. “A lot of that was pushed by the EU. I would say that they’re better off without it, personally, but I’m not making that as a recommendation. Just my feeling.”

But the extent to which populist anxiety about immigration is being stirred up on both sides of the Atlantic with unpredictable and possibly violent consequences is also causing growing alarm.

“It is critical that the United States and Britain, two of the world’s oldest and greatest democracies, stand together against hatred and violence,” said Clinton, in response to Thursday’s killing of a pro-immigration MP by an assailant allegedly shouting “Britain first”.

“This is how we must honor Jo Cox – by rejecting bigotry in all its forms and instead embracing, as she always did, everything that binds us together,” added the presumptive Democratic nominee.

“Her maiden speech in parliament celebrated the diversity of her beloved Yorkshire constituency, and passionately made the case that there is more that unites us than divides us. It is cruel and terrible that her life was cut short by a violent act of political intolerance.”