President Joe Biden has signed legislation to support Ukraine with another 40 billion dollars (£32 billion) in US assistance as the Russian invasion approaches its fourth month.

The legislation, which was passed by Congress with bipartisan support, deepens the US commitment to Ukraine at a time of uncertainty about the war’s future.

Ukraine has successfully defended Kyiv, and Russia has refocused its offensive on the country’s east, but American officials warn of the potential for a prolonged conflict.

The funding is intended to support Ukraine through September, and it dwarfs an earlier emergency measure that provided 13.6 billion dollars (£10.9 billion).

The new legislation will provide 20 billion dollars (£16 billion) in military assistance, ensuring a steady stream of advanced weapons that have been used to blunt Russia’s advances.

There is also eight billion dollars (£6.4 billion) in general economic support, five billion dollars (£4 billion) to address global food shortages that could result from the collapse of Ukrainian agriculture and more than one billion dollars (£800 million) to help refugees.

Mr Biden signed the measure under unusual circumstances.

Because he is in the middle of a trip to Asia, a US official brought a copy of the Bill on a commercial flight so the president could sign it, according to a White House official.

The logistics reflect a sense of urgency around continuing US support for Ukraine, but also the overlapping international challenges facing Mr Biden.

Even as he tries to reorient American foreign policy to confront China, he is continuing to direct resources to the largest conflict in Europe since the Second World War.