(Bloomberg) -- First Quantum Minerals Ltd.’s flagship copper mine received final approval from the Panamanian Congress for a revised operating contract, ending years of legal uncertainty. 

Lawmakers passed the new contract for the giant Cobre Panama mine in a third and final vote on Friday, with 44 legislators voting in favor to 5 against, according to a webcast of the legislative session. It now goes back to President Laurentino Cortizo for signing.

The vote took place as anti-mine protesters blocked highways and marched through the streets of Panama City. First Quantum shares were down 1.6% at 12:45 p.m. in Toronto, trimming losses from as much as 3% earlier Friday. 

Approval is a much-needed win for the government ahead of elections next year and ensures continuity of an engine of the local economy at a time of mounting fiscal pressures. It also removes a sizable overhang for First Quantum given the mine is its top money maker and accounts for about 1.5% of global copper output.

This “should provide more political certainty for the company and their largest asset going forward given the 20+ year fiscal stability agreement as part of the revised contract,” National Bank analysts including Shane Nagle wrote in a note to clients. 

The contractual uncertainties at Cobre Panama were spawned by a 2018 court ruling that preceded a prolonged renegotiation process as Panama sought more favorable terms. The two sides failed to reach an agreement by a mid-December deadline in a spat that led to a shutdown of mining operations.

A deal was finally brokered in March, but it still had to go through Congress. Last month, amid street protests, lawmakers suspended debate, sending the contract back for changes. The final version incorporates modifications such as limits on future expansions.

(Updates with comment from analyst in fifth paragraph)

©2023 Bloomberg L.P.