Sheikh Mohammed bin Abdulrahman Al Thani announced the agreement in the Qatari capital of Doha, the site of weeks of painstaking negotiations. He said the deal would go into effect on Sunday.