MGM Mirage ( MGG) and Mandalay Resort Group ( MBG) have agreed to sell Mandalay's stake in a Detroit casino, helping pave the way for completion of their pending merger.

The two companies announced Wednesday that they will sell Mandalay's indirect 53.5% interest in the MotorCity Casino to an affiliate of investor Marian Ilitch, who already owns a 25% stake in the casino.

The purchase price for the casino is $525 million. The transaction will be completed immediately before the two companies close their merger, which they expect to do during the second quarter of this year.

MGM Mirage already owns the MGM Grand Detroit Casino. Michigan law prevents one operator from owning more than one casino in Detroit.