Carolyn Kaster/AP

The ongoing bull market in stocks is the longest ever.

The S&P 500 bottomed nearly ten years ago on March 6, 2009, amid the Great Recession.

Days earlier, Obama said the market was getting so cheap that "buying stocks is a potentially good deal if you've got a long-term perspective on it."

The stock market has gained more than 300% since then.

Former President Barack Obama nailed it.

Ten years ago, on Friday, March 6, 2009, the S&P 500 index dropped to an intraday low of 666.79. No one knew for sure at the time, but that day marked the bottom of the stock market's decline in the midst of the Great Recession.

Obama, who entered office in 2009 — the year after stocks lost nearly 40% — had answered a reporter's question about the stock market three days earlier. He could not have known that his response would end up being one of the most perfectly timed market calls ever.

On March 3, Obama told reporters: "What you're now seeing is profit-and-earnings ratios are starting to get to the point where buying stocks is a potentially good deal if you've got a long-term perspective on it."

Since the March 2009 low, the S&P 500 has gained about 306%.

Andy Kiersz/Business Insider

Read more: Paul Krugman, Rick Rieder, and 47 more of the brightest minds on Wall Street reveal the world's most important charts

Obama also offered a valuable lesson in investing, which will come handy when the next recession or bear market hits.

"What I'm looking at is not the day-to-day gyrations of the stock market, but the long-term ability for the United States and the entire world economy to regain its footing," Obama said. "And the stock market is sort of like a tracking poll in politics. It bobs up and down day-to-day, and if you spend all your time worrying about that, then you're probably going to get the long-term strategy wrong."

Watch Obama's full response below:

Now Read:

NOW WATCH: There are serious health reasons why you shouldn't eat your boogers