Government funding was cut off shortly after midnight in a spending deadlock that could cut essential services and lead to mass layoffs.