DENVER (AP) _ A Wal-Mart heir who owns 40 percent of the St. Louis Rams agreed today to buy the Colorado Avalanche, Denver Nuggets and Pepsi Center.

The sale to Stan Kroenke was to be announced at a news conference later today. Kroenke will then meet with Mayor Wellington Webb, a spokesman for the mayor said.

The sale must still be approved by the NBA and NHL.

The agreement ends a tumultuous, months-long effort to find a new buyer for the NHL and NBA teams and the arena in which they play.

One bid collapsed last year after shareholders in Ascent Entertainment sued. A second bid fell through after the prospective buyer would not agree to terms to keep the teams in Denver for 25 years.

Last weekend, a group including former Broncos great John Elway, Broncos owner Pat Bowlen and New Jersey Devils owner John McMullen had announced they had city approval to buy the team. However, that attempt also failed.

Liberty Media Corp. of Denver acquired the teams and the arena when it agreed to buy Ascent Entertainment Group in February. It had planned to sell them within six months.

Kroenke is the brother-in-law of Bill and Nancy Laurie whose $400 million offer was rejected by Ascent stockholders last year.