The US Senate has agreed a $1.2tn spending package that will fund the US government through September.

Legislators narrowly averted a partial shutdown of the government with minutes to go before a midnight deadline.

While votes on a series of amendments are expected to continue for several hours, the agreement means that there will be no lapse in funding to key government departments.

It should be ready to be signed by President Joe Biden on Saturday.