The US House of Representatives narrowly approved a $1.1 trillion, nine-month federal spending bill late Thursday, barely two hours before a midnight government shutdown deadline.