President Barack Obama and Republican congressional leaders reached an 11th-hour deal on Sunday night to avert the first government default.