The United States and Qatar signed an agreement on Tuesday aimed at combating the financing of terrorism, as U.S. Secretary of State Rex Tillerson visited Doha to try to end a month-long rift between Western-allied Arab states.

Saudi Arabia, Bahrain, the United Arab Emirates and Egypt imposed sanctions on Qatar last month, accusing it of financing extremist groups and allying with the Gulf Arab states’ arch-foe Iran, allegations Doha denies.

Tillerson said the agreement signed with his Qatari counterpart, Sheikh Mohammed bin Abdulrahman al-Thani, had been under discussion for weeks.

“The agreement which we both have signed on behalf of our governments represents weeks of intensive discussions between experts and reinvigorates the spirit of the Riyadh summit,” Tillerson said at a joint news conference with Sheikh Mohammed.