(Adds GAP quote, details from source, updates share price)
By Noe Torres
MEXICO CITY, June 17 (Reuters) - Mexico's Supreme Court on Wednesday ruled in favor of airport operator Grupo Aeroportuario del Pacifico (GAP) in a four-year dispute with mining and railroad company Grupo Mexico.
The judges sided 3-2 with GAP, which sought to limit the stake Grupo Mexico holds in it.
The two companies have been locked in a legal battle since Grupo Mexico said in 2011 it planned to launch a tender offer for at least 30 percent of GAP.
GAP said its internal statutes prevented a single shareholder from holding more than 10 percent of the company.
GAP's lawyer, Virgilio Rincon, told reporters the ruling meant Grupo Mexico would have to trim its stake in GAP to 10 percent from a current 24 percent.
"Today legality won and there will be an orderly sale in the market without affecting the interests of investors," he said.
A source with knowledge of Grupo Mexico's thinking said the decision in favor of GAP was a surprise for the Grupo Mexico and that it would now have no other option but to sell its GAP shares to get its stake below 10 percent.
"There's no other way," the person said.
The source described Grupo Mexico's long-running effort to increase its stake in GAP as a pet project of Grupo Mexico's publicity-shy chief executive, German Larrea.
Grupo Mexico did not responded immediately to requests for comment. GAP said in a statement that the ruling upheld its statutes, which it has long defended.
Shares of GAP, which runs airports in 12 Mexican cities, including Guadalajara and Tijuana, were down 1.5 percent at 107.40 pesos, while those of Grupo Mexico fell 1.39 percent to 47.72 pesos. (Additional reporting by Christine Murray and Gabriel Stargardter; Editing by Lisa Von Ahn and Steve Orlofsky)