The agreement comes after days of talks with the US in Saudi Arabia.