Major agreement reached after 20 years of negotiations and during ongoing tensions with the US.