Stocks held slight gains through to Monday's close even as Wall Street faced uncertainty surrounding alleged acts of terror in Germany and Turkey. 

The S&P 500 was up 0.20%, and the Nasdaq rose 0.37%.

News broke late Monday afternoon that a truck had plowed through the crowd at an outdoor Christmas market in Berlin. Nine are reportedly dead and 50 have been injured. It is still not known whether the attack was deliberate, though police note the circumstances seem to indicate terrorism. The potentially intentional 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. 

Turkish stocks declined on Monday after the Russian ambassador to Turkey was shot and killed in Ankara. Russia has called the assassination an act of terrorism. 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 iShares MSCI Turkey ETF (TUR) - Get Report declined 2% on Monday, while the Turkish Investment Fund (TKF) fell 0.59%.

The Dow Jones Industrial Average continued its march toward the psychologically important 20,000, a level it flirted with last week. The Dow gained 0.20%, finishing roughly 120 points from its 20,000 milestone.

The blue-chip index is just one big rally away from the milestone. The Dow has moved within 50 points of the target, but hasn't yet clinched it. Markets have 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.

The move would be psychologically important, 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."

Federal Reserve Chair Janet Yellen touted the job market's strength on Monday afternoon, citing upward wage trends and low layoffs as factors. 

"After years or a slow economic recovery, you are entering the strongest job market in nearly a decade," Yellen told graduates at the University of Baltimore 2016 Midyear Commencement in Maryland early Monday afternoon.

Yellen did not make any comment on monetary policy. The remarks were her first since the central bank opted to hike rates by 25 basis points at its meeting last week. The Fed also telegraphed a faster pace of hikes, pegging its 2017 forecasts for three moves, up from two.

Monday also kicked off a slower week as trading desks empty out ahead of the Christmas and New Year's break. Still, there will be a number of data points for investors to trade on including existing home sales on Wednesday, the third and final estimate of third-quarter gross domestic product, and durable goods orders on Thursday, and new home sales data on Friday. This is the final full week of trading of the year.

Managing director of the International Monetary Fund, Christine Lagarde, was found guilty of criminal charges tied to misuse of public funds while in her position as finance minister of France. Lagarde was charged with "serious negligence" over a payout to a businessman in 2008. Lagarde began her second term at the IMF in February following her first five-year term. The charges could force her to resign from the position.

Oil prices ended slightly higher Monday even as worries resurfaced over whether major oil-producing nations could adhere to a recent production cut agreement. Organization of Petroleum Exporting Countries recently agreed to cut output to 32.5 million barrels a day, a limit to go into effect in January. However, OPEC's output remains at record highs with just two weeks left in the year. OPEC members have to cut production by more than 1 million barrels a day.

West Texas Intermediate crude oil for January delivery added 0.4% to close at $52.12 a barrel.

Lennar (LEN) - Get Report  exceeded profit and sales estimates in its fiscal fourth quarter. The homebuilder earned $1.34 a share over its recent quarter, up from $1.21 a share a year earlier and above estimates of $1.28. Revenue rose nearly 15% to $3.38 billion, topping consensus of $3.3 billion. CEO Stuart Miller projected a sunny outlook, pointing to President-elect Donald Trump's plans for economic spending as reason for higher expectations of company growth.

Walt Disney's (DIS) - Get ReportRogue One: A Star Wars Story had the second best December opening of all time, behind only last year's Star Wars: The Force Awakens. The world's largest entertainment company led the Dow higher, climbing 1.3% to its best level in seven months.

Deutsche Bank (DB) - Get Report is reportedly close to a penalty settlement with the U.S. Department of Justice over an investigation into whether it intentionally misled investors in its sale of mortgage-backed securities. Regulators initially hit the bank with a $14 billion charge.

Boeing (BA) - Get Report moved 1% higher after announcing plans for further cost cuts next year. The airplane manufacturer said voluntary layoffs would focus on cutting 10% of its managers and executives workforce in its Boeing Commercial Airplanes division.

United Technologies was upgraded to outperform from neutral at Credit Suisse. Its price target was increased to $125 from $108. Profit margin and earnings momentum are near a bottom, Credit Suisse said.

Costco (COST) - Get Report was upgraded to buy from neutral at Citi. The firm said short-term headwinds were fading and that its valuation had become more attractive.

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