Stocks finished Friday's session in the red, as market benchmarks closed the last day of 2021 slightly lower, but still within record levels as Wall Street ends a year of growth despite the enduring coronavirus pandemic.

Here's how market benchmarks settled to close out the year:

S&P 500 Index (SPY  ): -0.09% or -4.44 points to 4,774.29

Dow Jones Industrial Average (DIA  ): -0.08% or -27.53 points to 36,370.55

Nasdaq Composite Index (QQQ  ): -0.16% or -24.65 points to 15,741.56

Despite the session's losses, all three indexes finished both the month higher, with December marking the Dow's fifth-straight monthly gain and the Nasdaq marked a six-month winning streak. Moreover, market benchmarks capped off 2021 with double-digit returns. The S&P 500 led the gains by rallying over 27%, while the Dow and Nasdaq added over 19% and 21%, respectively, this year.

The S&P 500 posted 70 record closing highs this year, coming close behind its all-time record of 77 closing highs notched in 1996. Energy (XLE  ) and Real Estate (XLRE  ) were the best-performing sectors in the S&P 500, with both rising by more than 40% each. Technology (XLK  ) and Financials (XLF  ) were a close second, each climbing more than 30% for the year.

The Dow's gains were lead by top performances by components like Home Depot (HD  ) and Microsoft (MSFT  ), each rising more than 50% for the year. The tech-heavy Nasdaq was also carried higher by industry leaders like Apple (AAPL  ), Google (GOOGL  ) and Meta (FB  ).

Those gains came as the global economy began to recover from the coronavirus pandemic's financial impacts in the wake of effective vaccines developed by companies including, but not limited to, Pfizer (PFE  )-BioNTech (BNTX  ), Moderna (MRNA  ), Johnson & Johnson (JNJ  ) and AstraZeneca (AZN  ). The U.S. economy also benefited from the Federal Reserve's accommodative monetary policy throughout the year.

Next year is expected to yield another strong year for Wall Street, but many analysts do not anticipate the same level of gains as the market meets a new set of challenges in 2022, including rising inflation, the Federal Reserve's hawkish pivot towards raising interest rates, and the ongoing pandemic as the U.S. breaks record infection levels.