Hamas condemned the move as a coup and vowed to fight the measure.