November was second, with an average gain of 1.5 per cent.
Jack Ablin, chief investment officer for BMO Capital Markets, said investors made a habit of buying at the end of the year to position themselves for January, when stocks typically did well.
That set off a cycle.
"When I started in the business, I remember reading studies about the January Effect," says Ablin, who's worked in finance for three decades.
"Once that became common knowledge, the January Effect turned into the December Effect, and now appears to be creeping into November, too."
Stocks have climbed as the US economy continued to grow and countries in other regions gained strength, all of which sent corporate profits higher.
After a gain of 2.8 per cent in November the S&P 500 has gained 18 per cent so far this year, thanks in large part to big gains for technology companies such as Apple, Google's parent company Alphabet and Facebook.
Meanwhile, central banks are still steadying the markets with bond purchases and low interest rates.
The end of those stimulus programs are in sight, but by historic standards bond yields are low, which makes stocks more appealing as investments and borrowing money easier for people and companies to borrow money.
In the US, investors are pleased with President Donald Trump's cuts in regulations and lower corporate taxes.
It's also been a historically calm year for the market, with stock indexes hitting records at a steady pace without a lot of big moves up or down. Given all that, conditions seem right for further gains in in December.
"Chances are good that we end up with a positive final month of the year," says Sam Stovall, chief investment strategist at CFRA Equity Research.
One concern for investors and experts is that stocks are expensive relative to their earnings.
Then again, they've felt that way for most of the year and stocks kept going higher.
And as usual, investors will keep a close eye on the Federal Reserve and the US economy: stocks might falter if Wall Street gets the sense that economic growth isn't strong enough, or a combination of weak growth and rising interest rates might slow the economy.
Investors believe the Federal Reserve will raise interest rates at its meeting on December 13.
Ablin, of BMO Capital Markets, says some investors might refrain from buying in December and wait until January for tax reasons.
But even in a surprisingly good year, there's reason to think the market will have a solid finish: When the S&P 500 is up 15 per cent in the first 11 months of the year, it does better in December than it does in years with smaller gains, according to Ryan Detrick of LPL Financial.
- Associated Press