The Dow Jones Industrial Average tried to capture the historic 20,000 level on Tuesday, but a lack of forward momentum put it within agonizing reach without pushing it over the edge. 

The Dow was up 0.46% and finished less than 30 points from the psychologically important level. At its session highs, the index was just 13 points from 20,000. The Dow did manage to secure a new all-time closing high of 19,974, smashing the old record of 19,911 set on Dec. 13. The Dow was also on track to post a nearly 9% gain for the quarter, its best quarterly increase since the fourth quarter of 2013.

The S&P 500 was up 0.36% and just a point away from hitting a new record record. The Nasdaq gained 0.49% and posted a new record close of 5,483.

The Dow, a blue-chip index which houses 30 of Wall Street's premium stocks, previously hit the 19,000 mark for the first time just a month ago on Nov. 22. The Dow first hit 100 in early 1906, just over two decades since its first day of trade. It then took more than 60 years to reach its 10,000 milestone, an achievement it made in November 1972. The Dow first hit 10,000 in March 1999.

A move to 20,000 would be worthy of the headlines, though analysts noted that the Dow holds less significance as a barometer of the markets' health than the more diverse S&P 500.

"Dow 20,000 certainly sounds great, but there are a few things one should keep in mind before putting too much emphasis on it," Andrew Adams, market strategist at Raymond James, wrote in a note. "Remember that the DJIA consists of just 30 U.S. stocks, so it is not as representative of the broad market as it used to be, which is why the S&P 500 is more widely used for benchmarking purposes."

Adams also pointed out that each 1,000-point milestone is less monumental as the percentage increase from one to the next becomes smaller. Back in 1999, a 1,000-point move represented 10% of the index. Today, a 1,000-point move is just 5%.

The Dow has moved higher in response to optimism over President-elect Donald Trump's proposed spending plans. Trump's administration, viewed as Wall Street friendly, has already backed deregulation, infrastructure spending and tax cuts.

Stock market gains were broad across all sectors with the financials and telecom spaces receiving the biggest boost. Financials stocks including Citigroup (C) - Get Report , Goldman Sachs, and Bank of America (BAC) - Get Report moved higher, while the Financial Select Sector SPDR ETF (XLF) - Get Report added 1%.

Citigroup is a holding in Jim Cramer's Action Alerts PLUS Charitable Trust Portfolio. Want to be alerted before Cramer buys or sells C? Learn more now.

BlackBerry (BBRY)  declined by 2.8%, even after posting surprise profit. The company earned an adjusted 2 cents a share, higher than consensus of breakeven earnings. But revenue of $289 million fell short of estimates of $330 million. Others in the space moved higher, including AT&T (T) - Get Report , Verizon (VZ) - Get Report , and Telefonica (TEF) - Get Report .

Uncertainty reigned after separate terror attacks in Berlin, Zurich and Turkey on Monday. News broke late Monday afternoon that a truck had plowed through the crowd at an outdoor Christmas market in Berlin. Twelve are reportedly dead and 48 have been injured, some severely. Police said the event was "probably a terror attack." The attack echoes a similar act of terror in Nice, France, on Bastille Day earlier this year in which a cargo truck plowed into a crowd, killing 86 and injuring more than 400.

Separately, a gunman shot up a mosque in Zurich on Monday, injuring three. Swiss police have reportedly discovered a body in the vicinity believed to be the shooter. The mosque was popular among Somali migrants.

The Russian ambassador to Turkey was shot and killed in Ankara, Turkey, on Monday. The gunman, a 22-year-old Turkish policeman, shouted slogans related to Aleppo, the warntorn city in Syria. The two countries have had tenuous relations as the civil war in Syria spilled over into bordering Turkey. Russia backs Syrian President Bashar al-Assad against rebel troops in Syria.

The three separate acts of terror escalated worries over terrorism worldwide, a concern President-elect Donald Trump often flamed during his campaign.

Safe-haven assets, including currencies, were on the move after the series of terror attacks. The Dollar Index, in particular, was on a tear, climbing 0.44% to trade at 103.58. The index was on track to close at its best level in roughly 14 years.

Crude oil prices headed slightly higher ahead of domestic inventories data out after the bell. The American Petroleum Institute will release weekly stocks data this afternoon, followed by the official data from the Energy Information Administration on Wednesday morning.

West Texas Intermediate crude for February delivery added 0.5% to close at $53.30 a barrel.

Rite Aid (RAD) - Get Report jumped by 5% after agreeing to sell 865 of its stores to Fred's (FRED) for $950 million. The move is part of Rite Aid and Walgreens Boots Alliance (WBA) - Get Report plans to sell off assets in order to gain approval from the Federal Trade Commission for its merger. Fred's shares surged more than 80%.

Walgreens is a holding in Jim Cramer's Action Alerts PLUS Charitable Trust Portfolio. Want to be alerted before Cramer buys or sells WBA? Learn more now.

General Mills (GIS) - Get Report reported second-quarter adjusted earnings of 85 cents a share, missing Wall Street estimates by a penny. Net sales in the quarter fell 7% to $4.1 billion because of lower organic net sales and the divestiture of the North American Green Giant business, the company said.

Darden Restaurants (DRI) - Get Report reported a surge in second-quarter profit. Earnings nearly doubled to 64 cents a share over the quarter, coming in as analysts' expected. Revenue of $1.64 billion came in slightly short of estimates, while same-store sales rose 1.7%, 200 basis points above forecasts. Same-store sales at Olive Garden rose 2.1%.