WASHINGTON—After three years of ducking crises with last-minute deals, Congress finally ran out of ways to patch over its differences. Unable to meet a midnight Monday deadline for funding the government, lawmakers allowed it to shut down.

The White House ordered federal agencies to suspend a vast array of activities shortly before midnight, after a day of frantic legislative volleying left Senate Democrats and House Republicans at an impasse over government spending and the 2010 health-care law. The next steps to resolve...