MEXICO CITY — The government of El Salvador won a long-running legal battle on Friday when an international arbitration panel ruled that it did not have to pay compensation to a mining company that was denied a concession to drill for gold.

The case had been watched by antimining activists, who had pointed to it as a test of the rights of governments to make laws protecting their citizens’ health and the environment against challenges from corporations.

The panel, the International Center for Settlement of Investment Disputes, at the World Bank in Washington, accepted El Salvador’s argument that the company, Pac Rim Cayman, did not meet all the legal requirements to receive a permit.

The ruling was a relief to the Salvadoran government, which faced a demand for $314 million in compensation from Pac Rim Cayman for the loss of expected profits from the mining venture.