NEW YORK — Gold shone brighter than any other investment in an up-and-down quarter.

Over the last few months gold continued to recover its appeal as investors reacted to a host of worries. Real estate also outperformed the market, as it’s done in recent years.

Most types of investments did fairly well in the second quarter as the market put the winter’s woes in the rearview mirror. A wave of nervousness over Britain’s vote to leave the European Union washed over the market in late June, but many of those losses were undone by the three-day rally that ended the quarter.

An analysis of nine different types of investments by The Associated Press showed that eight gained value in the second quarter. Only large-cap companies based overseas lost value.

Those stocks plunged in June as investors worried Britain might vote to leave the EU, and when that was confirmed, they fell further. They wound up with a small loss in the second quarter, but they have tumbled over the last year as investors feared for the health of the global economy. Stocks based in emerging markets have also struggled over that time.

The AP analysis, using data from FactSet, shows that the top-performer over the past 10 years for regular investors – those who invest a portion of their income every month and hold for the long term – has been real estate investment trusts, which have done a bit better than U.S. stocks.

That’s true even though the period includes the U.S. housing crisis. After the crisis passed, investors snapped up REITs as real estate gradually rose in value and investors were drawn to the large dividend payments REITs pay.

Real estate is the best-performing asset class over the last year, the last five years, and the last 10 years. Gold, however, has lagged most other kinds of investments over that period.