Patience can be a virtue. Thanks to the wonders of compound interest, anyone can grow a relatively modest investment into a million-dollar nest egg over time. For example, investing $300 a month into stocks delivering a 10% average annual return would grow into $1 million in about 35 years. 

You can potentially become a millionaire faster by either investing more money or making a higher-returning investment. One sector that has historically delivered high returns is real estate. While known more for their ability to produce passive income, real estate investment trusts (REITs) have delivered 11.6% total annualized returns over the past 20 years. At that rate, REITs can grow a $300 monthly investment into $1 million in about 31 years. Here are a couple of REITs that could help their investors become millionaires in the decades ahead.

A wealth-creating machine

Realty Income (O 0.52%) has done a fantastic job growing value for its shareholders over the years. Since its public listing in 1994, the REIT has delivered a compound average annual total return of 15.1%. As a result, a hypothetical investor who bought $300 of its stock each month would have become a millionaire in 26 years. 

One of the keys to Realty Income's millionaire-making ability has been its steadily rising passive income stream. The REIT has increased its dividend 116 times since 1994, growing its payment at a 4.4% compound annual rate. It has repeatedly raised its payout by steadily expanding its portfolio of income-producing real estate.

Realty Income sees an enormous opportunity to continue growing in the coming years. The REIT estimates that there's $12 trillion of owner-occupied commercial real estate in its core global markets, providing it with a vast pool of acquisition opportunities. The company has a top-notch financial profile, giving it plenty of financial flexibility to continue making deals. That leads the REIT to believe it can continue growing its portfolio and dividend, -- which currently yields around 4% -- at an attractive rate. Overall, it anticipates delivering average annual total returns in the double digits.

A steady wealth creator

Equity Residential (EQR 2.41%) also has an excellent track record of growing shareholder value. The apartment REIT has delivered a 12.4% average annual total return since its initial public offering in 1993. At that rate, a hypothetical investor who bought $300 of its stock each month would become a millionaire in about 30 years.

Like Realty Income, one of the keys to Equity Residential's ability to deliver double-digit total returns has been its steadily rising dividend. Equity Residential has grown its payout at a 6.4% compound annual rate over the last decade.

The company has focused on owning apartments in high-cost housing markets where supplies are constrained. That's kept occupancy levels high, enabling the REIT to steadily increase rental rates. In addition, Equity Residential has developed new apartment communities and made acquisitions to steadily expand its portfolio and rental income.

The REIT expects its rental income to continue rising in the future. It has started expanding its portfolio from high-cost coastal markets to faster-growing Sun Belt metro areas, positioning it to capitalize on the rent growth upside of those markets. The company made several acquisitions and is investing in several more development projects. It's funding these investments by selling older properties and utilizing its strong financial profile.

Equity Residential's moves to accelerate its rental income growth should enable the REIT to keep increasing its dividend, which currently yields 3.2%. It has the potential to continue delivering total annual returns approaching its historical level.

Get rich slowly with these REITs

Realty Income and Equity Residential have excellent track records of enriching their inventors, driven in part by their ability to steadily grow their attractive dividends. With plenty of growth still ahead, these REITs could continue delivering double-digit total annual returns. They could very well turn long-term investors into millionaires in the future.