Some of the cartoons depict Muhammad as a terrorist. One image depicts the prophet wearing a turban shaped as a bomb with a burning fuse.

Islam bans any depiction of Muhammad or Allah, in case they lead to idolatry.

The cartoons have sparked protests, flag burning and calls for boycotts across the Islamic world.

Correspondents say armed protests such as Thursday's are common in Gaza.

On Monday, about 15 gunmen burst into the same EU offices and warned citizens of Denmark and Norway, where a newspaper reignited the row earlier this month, not to enter Gaza until an apology was made.

The Norwegian government, however, has taken the threats from Palestinian militant groups seriously and it announced on Thursday that its mission in the West Bank had been closed to the public temporarily.

"We have decided to close our mission in al-Ram to the public for the time being as we consider the security situation," Norwegian Foreign Ministry spokesman Rune Bjaastad said.