RAMALLAH, West Bank — The announcement from Hamas over the weekend arrived like a bouquet of roses for Mahmoud Abbas, president of the Palestinian Authority.

After months of pressure from Mr. Abbas and more than a week of talks in Cairo, Hamas, the militant Islamist group that has controlled the Gaza Strip for a decade, abruptly offered to hand him its keys to the territory.

It agreed to Mr. Abbas’s demands that Hamas disband a so-called shadow government it set up earlier this year.

It invited the Palestinian Authority, dominated by Mr. Abbas’s secular Fatah movement, to send its ministers into Gaza and “carry out its duties immediately.”