Palestinian militants in the Gaza Strip had fired rockets towards Jerusalem, carrying out a threat to punish Israel for violent confrontations with Palestinians.