The move by Anders Fogh Rasmussen comes amid threats from Palestinian factions to harm foreign nationals as revenge for what they say is an offence to Islam.
Earlier on Thursday the joint command of the Popular Resistance Committee and Al-Aqsa Martyrs’ Brigades issued a statement saying that all foreign nationals and those working in the diplomatic corps in the occupied territories could be considered targets.
The groups demanded an apology over the publication of the caricatures, one of which showed Prophet Muhammad with a bomb in his turban.
The dispute over the images, first published in September in Denmark, then again in January in Norway, has prompted a boycott of Danish and Norwegian products by Muslims.
As the debate over freedom of speech and respect for religious beliefs has intensified, more European papers have published the cartoons.
The BBC broadcast the images, saying they would help audiences to understand the strong feelings felt by affronted Muslims.
The cartoons have triggered
Islam holds that no image of Prophet Muhammad should be made for fear of idolatry and misrepresentation.
But on Thursday evening, Rasmussen asked ambassadors in Denmark, including those from Muslim countries, to meet him to discuss the controversy.
The offer follows a refusal in October to meet representatives from 10 majority Muslim countries who objected to the drawings.
Earlier this week he also refused to apologise for the cartoons, saying the newspaper had not intended to upset Muslims.
The government “cannot make apologies on behalf of a Danish newspaper”, he said. “That is not how our democracy works.”
The Danish Jyllands-Posten newspaper has apologised for causing offence, but stood by its decision to print the cartoons. The drawings were later reprinted by newspapers in Spain, France and Germany.
It was not immediately known which countries’ ambassadors would attend the meeting on Friday.
The prime minister’s office said the prime minister and foreign minister would brief the ambassadors on the international reaction to the drawings and tell them about the government’s position and actions in the case.
The Danish foreign ministry earlier warned its nationals against travelling in Gaza after armed men there threatened to kidnap Danes and citizens of other countries where the cartoons have been published.
“We demand that the offices and consulates of the three countries concerned close, otherwise we will not hesitate to destroy them”
A statement from armed groups in Palestinian territories
Armed groups in the Palestinian territories have threatened to attack Danish, French and Norwegian nationals.
Abu Mudjahid, a spokesman for the factions, said the threat was serious and extended to the nationals of all countries that had published the caricatures.
“We demand that the offices and consulates of the three countries concerned close, otherwise we will not hesitate to destroy them,” the statement said.
In the Gaza Strip on Thursday, a dozen men from Islamic Jihad and an armed faction of Fatah known as the Yasser Arafat Brigade surrounded the EU compound and fired into the air. They demanded an apology within 48 hours over the cartoons.
The threats came as the managing editor of a French daily that republished the cartoons was sacked.