William Miller has been at the helm of Baltimore-based Legg Mason’s Value Trust fund since April 1982. (Tim Boyle/BLOOMBERG)

William H. Miller, who approached Warren Buffett-like acclaim when his Legg Mason Value Trust fund outperformed the Standard & Poor’s 500-stock index for 15 consecutive years, will step down as the fund’s chief investment officer in April after several years of dismal performance.

Miller’s precipitous fall from near-cult status shows how even the most experienced and savvy investor can be laid low by feckless markets and risky bets.

“Stars depend on market cycles and investors’ appetites,” said Michael Farr, president of Farr, Miller & Washington, a District-based investment firm. “Investors are worshipers at the church-of-what’s-working-now. Bill Miller is an outstanding, world-class money manager. And when whatever was working now didn’t work his way, there was a hue and cry to throw the bum out.”

Miller, who has been at the helm of Baltimore-based Legg Mason’s Value Trust fund since April 1982, will be succeeded by Sam Peters, 42.

“We recognized Sam as a potential portfolio manager for Value Trust when we hired him in 2005, then observed his steady hand during the 2008 financial crisis, and last year named him co-manager of Value Trust for the purpose of succeeding me as sole manager,” Miller, 61, said in a statement.

A few years ago, Miller stood on the commanding heights of the investment world, mentioned in the same breath as Berkshire Hathaway’s Buffett and former Fidelity Magellan Fund manager Peter Lynch.

Miller’s wonkish, contrarian style of betting big on out-of-favor stocks served him — and his investors — well. The Value Trust fund racked up fat returns, including a 48 percent gain in 1998 and 44 percent in 2003.

Financial journalists and markets closely watched his returns every December to see whether Value Trust could close out the year with another drubbing of the S&P.

But the housing crash and the credit crisis wreaked havoc on the mutual fund. It lost 55 percent in 2008.

Investors left in droves. The fund, which managed $20 billion at its peak, now has $2.8 billion under its management.

Ed Mathias, a Carlyle Group managing director who has known Miller for decades, said Miller ran a very concentrated portfolio that was both risky and successful.

“The market and age eventually take their toll,” Mathias said.

Peters said the Value Trust fund made two crucial mistakes over the past decade: It did not invest enough in stocks that rise and fall with the global economy when they were cheap a decade ago. And it mistimed the credit crisis, overweighting in financial stocks going into the Wall Street crisis of 2008.

Peters said Thursday that equities today are cheap and that there is much upside in front of the Value Trust fund.

“I’m much luckier taking the mantle from Bill in this valuation context than I would have been five or 10 years ago,” he said.

Instead of being compared to Buffett and Lynch, investors on Thursday were comparing Miller to fallen heroes such as the once-legendary Julian Robertson, who closed his Tiger Management hedge fund because of investment reversals. One even compared Miller to former politician and Goldman Sachs chief executive Jon Corzine, whose MF Global financial services firm filed for bankruptcy last month.

Others were more sanguine.

“He was one of the greatest investors ever,” said Manny Friedman, who runs EJF Capital, an Arlington-based investment fund. “Every great investor, including Warren Buffett, has periods when they are completely wrong. You have great periods. You go through little slumps. It’s like Babe Ruth batting. He is going to have years when he doesn’t do so well. That’s called life.”