The federal government shut down Wednesday at midnight after Congress failed to reach an agreement to continue funding federal agencies and programs, prompting millions of workers to be furloughed, with potential permanent layoffs expected and closures of some government services, though some mandatory programs will remain open.