The US government was on the verge of shutting down unless Congress reached a funding deal before the start of the new fiscal year, on 1 October.