NEW YORK – U.S. stocks closed lower on Wednesday as investors grappled with a threat from President Donald Trump to shut down the government if Congress fails to fund a Mexico border wall.

Stocks managed to briefly pare losses after comments from U.S. House Speaker Paul Ryan calling a government shutdown unnecessary. Yet that was not enough to calm nerves as the deadline to approve spending measures draws near and a fight looms over raising the cap on government borrowing.

Congress will have about 12 working days when it returns from its summer recess on Sept. 5 to raise the debt ceiling before the U.S. Treasury exhausts the last of its options to remain current on all of the federal government’s obligations.

Credit ratings agency Fitch Ratings said a failure to raise the ceiling in a timely manner would prompt it to review its rating on U.S. sovereign debt, “with potentially negative implications.”

“What we’ve seen over this last week or so in financial markets has been a bit of wiggling around regarding the U.S. political situation,” said Paul Eitelman, multi-asset investment strategist at Russell Investments in Seattle.

“Ultimately, I don’t think markets care that much about the noise coming out of Washington, D.C., but they’re trying to translate what that noise means for the potential for tax reform.”

Trump’s comments also affected the bond and currency markets, with the dollar index slipping 0.4 to 93.14 and 10-Year U.S. Treasury yields falling a touch below 2.17 percent on safety buying.

Investors have grown increasingly concerned about Trump’s ability to legislate his pro-growth agenda given the near-constant political turbulence in the White House.

The Dow Jones Industrial Average fell 87.8 points, or 0.4 percent, to 21,812.09, the S&P 500 lost 8.44 points, or 0.34 percent, to 2,444.07 and the Nasdaq Composite dropped 19.07 points, or 0.3 percent, to 6,278.41.

The CBOE Volatility index, a widely-followed measure of market anxiety, increased 6.0 points to 12.03, its first rise in four days.

Investors looked towards a speech by Federal Reserve Chair Janet Yellen at a meeting of central bankers in Jackson Hole, Wyoming, on Friday, which will be scrutinized for clues on the U.S. central bank’s monetary policy.

Also weighing on sentiment was data showing sales of new U.S. single-family homes unexpectedly fell in July to a seven-month low.

“It seems like the story there is the affordability for housing is really what is weighing on the new-home market,” said Lindsey Bell, investment strategist at CFRA Research in New York.

The consumer discretionary <.SPLRCD> index ended down 0.8 percent, dragged lower by a 3.71-percent decline in Lowe’s Companies <LOW.N> after disappointing results and forecast.

Bigger rival Home Depot <HD.N> dropped 0.54 percent to $149.10.

Shares of advertising firm Omnicom <OMC.N> dropped more than 6.94 percent to $72.71, while Interpublic Group <IPG.N> fell 6.32 percent to $72.71 after WPP <WPP.L> cut its sales forecast after consumer goods giants curbed spending. WPP’S U.S.-listed shares <WPPGY.O> sank 11.49 percent..

Advancing issues outnumbered declining ones on the NYSE by a 1.11-to-1 ratio; on Nasdaq, a 1.20-to-1 ratio favored decliners.

The S&P 500 posted 49 new 52-week highs and 10 new lows; the Nasdaq Composite recorded 98 new highs and 85 new lows.

About 5.04 billion shares changed hands in U.S. exchanges, below the 6.2 billion daily average over the last 20 sessions

Reuters also reported European equities shrugged off a survey that showed euro zone manufacturing businesses in August had their best month of growth in six and a half years.

The upbeat survey was the latest sign of economic recovery in the single currency bloc, which may lead the European Central Bank to start scaling back its stimulus program.

Trump’s comments at a rally in Phoenix on Tuesday came as lawmakers face a deadline in late September to raise the U.S. debt ceiling or risk defaulting on debt payments.

Fitch Ratings said a failure to raise the federal debt ceiling in a timely manner would prompt the credit ratings agency to review the U.S. sovereign rating “with potentially negative implications.”

Michael O’Rourke, chief market strategist at JonesTrading in Greenwich, Connecticut, said the willingness to shut down the government over funding for a wall on the Mexican border doesn’t inspire confidence.

But how much emphasis to put on Trump’s remarks is hard to say, said John Canavan, market strategist at Stone & McCarthy Research Associates in New York.

“It’s largely dependent on Congress to keep the government open. You can’t entirely discount his comments, but based on the history of his off-the-cuff comments you can’t take them as policy stance,” Canavan said.

MSCI’s gauge of stocks across the globe <.MIWD00000PUS> shed 0.06 percent and the pan-European FTSEurofirst 300 index <.FTEU3> closed down 0.51 percent. Stocks closed higher in Asia.

Oil prices rose after U.S. crude inventories declined for the eighth straight week and U.S. crude production increased only slightly.

Brent crude futures <LCOc1> rose 70 cents to settle at $52.57 a barrel, while U.S. West Texas Intermediate crude futures <CLc1> settled at $48.41, up 58 cents.

Dovish comments by ECB chief Mario Draghi had little market impact though investors were keeping a close eye on monetary policy a day before the start of a central bank symposium in Jackson Hole, Wyoming.

Neither Federal Reserve Chair Janet Yellen nor Draghi is going to tip their hand on the future of monetary policy tightening in their speeches, said Michael Arone, chief investment strategist at State Street Global Advisors.

“It’s going to be somewhat of a non-event, even though we’ll all have our eyes glued to what comes out of there,” Arone said. “The most exciting thing about Jackson Hole this week is probably going to be the fishing.”

The dollar fell 0.55 percent to 108.96 yen <JPY=>, with the dollar index slipping 0.4 percent to 93.167 <.DXY>. The euro was propped up by strong German and French PMI survey readings, though analysts warned its gains could be short-lived due to concerns about heavy one-sided bets. The euro rose 0.48 percent to $1.1817 <EUR=> and hit a fresh 10-month peak against the British pound <EURGBP=D3>, above 92 pence.

Sterling fell below $1.28 <GBP=> for the first time since late June. Concerns about Britain’s economic prospects and the Brexit process encouraged investors to push the pound lower.

Benchmark 10-year Treasury notes <US10YT=RR> were last up 13/32 in price to yield 2.1694 percent. “To the extent that equities are reacting to last night’s speech … you can say that’s bleeding now into fixed income,” said Jim Vogel, an interest rate strategist at FTN Financial in Memphis.

– Reuters.