NEW YORK — It took a while, but investors are beginning to believe this bull can fly.

One of the greatest runs for the stock market in history is marking its eighth anniversary, and this time investors are joining the party. They’re putting more dollars into mutual funds and exchange-traded funds that invest in U.S. stocks, a turnaround from earlier years, even though critics see a long list of reasons for caution.

It was on March 9, 2009, that stocks finally hit bottom in the financial crisis, after the Standard & Poor’s 500 index lost 55 percent in 17 months and gutted retirement and other investment accounts. The next day, the S&P 500 perked up by 6.4 percent, and it’s been racing higher ever since thanks to extraordinary stimulus from the Federal Reserve and a recovery in corporate profits, with only a few interruptions in between.

A $10,000 investment in the largest U.S. stock mutual fund has turned into nearly $42,000 since the bottom, and this bull market for stocks has already outlasted all but one other since World War II. Only the 1990-2000 run, which ran through the top of the dot-come bubble, lasted longer.

The long vault higher for stocks has helped buy-and-hold investors not only recover all their losses from the Great Recession but also to add to them. The S&P 500 set a record earlier this month, which means anyone with the fortitude to hold on through worries about a double-dip recession, the 2011 European debt crisis and a series of other shocks is now sitting on more than ever before. Unfortunately, not everyone held onto their stocks.

Through the years, many investors remained leery of the market, with the memory of the financial crisis still too painful. They stuck instead to bonds and other safer confines. In 2015, for example, investors pulled $107 billion more out of U.S. stock mutual funds and ETFs than they put in, according to the Investment Company Institute. In the first 10 months of last year the trend continued, with investors yanking a net $109 billion out of U.S. stock funds.

Then, the election happened. Donald Trump’s surprise White House victory in November raised hopes that corporate tax cuts, less regulation and other business-friendly policies would jolt the economy out of its slow-growth rut. Stocks surged, with S&P 500 index funds packing roughly a year’s worth of gains into a few months, and investors quickly followed. Since November, investors have plugged more than $60 billion into U.S. stock funds.

Critics say this flow back into the market is happening at a time when stocks are already looking expensive. Prices have risen faster than corporate earnings, which means the market at the least no longer looks cheap. Analysts along Wall Street also say optimism may actually be too high, with expectations overdone for how much Washington can do to help businesses quickly.

More elections around the world are also on deck with the potential to upset the global status quo, such as in France. All the while, the Federal Reserve will likely continue to raise interest rates. That has many along Wall Street calling for stocks to pull back at some point this year.

Goldman Sachs strategists, for example, say the market may be close to its peak for the year, and they expect the S&P 500 to dip a few percent by the end of the year.

At the same time, many analysts remain optimistic about the long term and say any pullbacks for the market will likely be only temporary. It would take a recession or a burst higher in inflation, which would force the Federal Reserve to raise interest rates quickly, to kill the bull market, and many analysts see those scenarios as unlikely. Stephen Auth, chief investment officer for equities at Federated Investors, says this may be a bull market that ends up running 20 years.

He sees this run as entering its third phase. The first, which lasted from 2009 until about 2012, was the result of simply avoiding the meltdown of the economy that markets were fearing. The second, which lasted until last November, was marked by steady but slow economic growth and a Federal Reserve that kept interest rates at nearly zero. Now, he says the third will be marked by stronger growth in the economy and corporate earnings.