The Dow Jones Industrial Average gave up almost half of the largest gain in its history on Thursday, before rallying as U.S. stock markets overcame concerns about a softer housing market and turmoil in Washington.

The blue chip index, which fell as much as 522 points in late morning trading, erased those losses and climbed 1.1 percent to 23,138 by the close of New York trading, building on a record gain of 1,086 points the day before. The broader S&P 500 rose 0.9 percent while the tech-heavy Nasdaq added 0.4 percent as market volatility hovered near year-to-date highs.

The early declines reflected confusion about the pace of U.S. growth, which many economists expect to slow in 2019, and concern about a partial government shutdown that began the Friday before Christmas, when Trump refused a funding proposal that didn't allocate as much as he wanted for a wall along the southern U.S. border.

"Do the Dems realize that most of the people not getting paid are Democrats?" the president mused on Twitter, apparently referring to government workers living in and around the District of Columbia. The party's position, he added later the same day, would leave his 2020 opponents campaigning on "an open southern border and the large scale crime that comes with such stupidity."

Democratic leaders, meanwhile, laid the blame for the shutdown squarely at the president's feet.

"Instead of bringing certainty into people’s lives, he’s continuing the Trump shutdown just to please right-wing radio and TV hosts," the party's top congressional leaders, Sen. Chuck Schumer and Rep. Nancy Pelosi, said in a joint statement on Christmas Eve. "Different people from the same White House are saying different things about what the president would accept or not accept to end his Trump shutdown, making it impossible to know where they stand at any given moment."

In a nationally televised meeting with Schumer and Pelosi earlier in December, the president had said he would take full responsibility for the move.

"I am proud to shut down the government for border security," Trump told Schumer on Dec. 11, "because the people of this country don’t want criminals and people that have lots of problems and drugs pouring into our country. So I will take the mantle. I will be the one to shut it down. I’m not going to blame you for it."

On the economic front, housing price growth slowed for the seventh straight month in October, according to the S&P CoreLogic Case-Shiller U.S. National Home Price Index, which was updated on Wednesday. Prices increased just 5.5 percent. Unemployment remains at a near 50-year low, however, and American retailers reported the highest holiday sales in six years.

"While recession is a risk, there is no sign of a recession at this point in time," said Fred Cannon, the head of research at New York brokerage Keefe, Bruyette & Woods. "It looks as though the economy is slowing, but not dropping."