(Updates with House passage of short-term funding measure, paragraph 3)
WASHINGTON, Jan 18 (Reuters) - Government agencies were warning U.S. employees on Thursday of a possible federal shutdown at midnight on Friday, as the Republican-controlled Congress and the White House scrambled to pass legislation to keep the lights on in Washington.
President Donald Trump, answering reporters' questions at the Pentagon, said on Thursday the U.S. government "could very well" shut down and that would be harmful to the military.
The Republican-controlled U.S. House of Representatives on Thursday night approved a short-term funding extension through Feb. 16, although the bill's prospects looked uncertain in the Senate.
A shutdown would be an embarrassment for Republicans, who control the levers of power in the capital. But it might fulfill a wish Trump expressed in May 2017, when he tweeted: "Our country needs a good 'shutdown' in September to fix this mess."
When the government shuts down, which has only happened three times in a meaningful way since 1995, hundreds of thousands of "non-essential" federal workers may be put on furlough, while "essential" employees, dealing with public safety and national security, would keep working.
At the Pentagon, spokesman Christopher Sherwood said: The Defense Department has to send out guidance on a potential shutdown prior to a shutdown. It will be sent out tomorrow, but could be sent today.
Secretary of State Rex Tillerson, asked about a possible shutdown while posing with Jordan's foreign minister for photographs at the department's headquarters, said: "Were ready if that's what happens. ... We hope not, but we're ready.
The Government Accountability Office, an in-house watchdog unit of Congress, in an internal memo to staff seen by Reuters, said it would begin shutting down if Congress did not approve a temporary funding bill, known as a continuing resolution (CR).
"In the absence of an extension of the CR, GAO would be without funding and will be required to begin shutting down its regular, ongoing operations on Monday," the memo said.
Some financial regulators would get through a shutdown unscathed, although others might not. The Federal Reserve, the Federal Deposit Insurance Corp, the Office of the Comptroller of the Currency, as well as the Consumer Financial Protection Bureau, do not rely on Congress to approve their funding. So they could keep operating during a shutdown.
But the Securities and Exchange Commission and the Commodity Futures Trading Commission, which police financial markets, could be hit.
The SEC's budget is set by Congress, but funds itself by collecting fees from the financial industry. It has said in the past it would be able to continue operations temporarily during a shutdown. But it would have to furlough workers if Congress went weeks before approving new funding.
The CFTC would face the most direct impact, having to furlough 95 percent of its employees immediately. An agency spokeswoman said the derivatives regulator could call in additional staff, however, in the event of financial market emergency.
The Justice Department, with many "essential" workers, has a shutdown contingency plan under which about 95,000 of the departments almost 115,000 staff would keep working.
(Reporting by Arshad Mohammed, Idrees Ali, Pete Schroeder, Sarah N. Lynch, Michelle Price, Doina Chiacu, Lawrence Hurley and Diane Bartz; Editing by Kevin Drawbaugh and Peter Cooney)