MEXICO CITY (Reuters) - Railroad and mining company Grupo Mexico has sold almost all of its shares in Mexican airport operator Grupo Aeroportuario del Pacifico (GAP), a regulatory filing showed on Friday.

The two companies had been locked in a legal battle since 2011 when Grupo Mexico said it planned to launch a tender offer for at least 30% of the airport operator.

GAP has said its bylaws limit shareholders to holding no more than 10% of its outstanding stock and has been trying to force Grupo Mexico to reduce its stake.

(This story refiles to add dropped word in headline)

(Reporting by Noe Torres)