The rally in the northwestern city of Peshawar was one of many that have erupted across the Muslim world since the cartoons were printed. The drawings first appeared in Denmark in September and were later reprinted by other European newspapers.
Police said about 5,000 people were protesting, and some burned effigies of the Danish prime minister and a cartoonist who drew the prophet.
The protesters chanted "Hang the man who insulted the prophet" and "God is great" as they rallied in a bazaar in the capital of North West Frontier province. Most were bearded religious students wearing white prayer caps.
Akram Durrani, chief minister of the province, led the protest. He was joined by other members of his provincial government.
Muslims have been outraged because Islamic tradition bars any depiction of the prophet to prevent idolatry. Under Pakistani laws, insulting the prophet or Islam's holy book, the Quran, can be punished with the death sentence, reports the AP.
Russian President Vladimir Putin, in his speech dedicated to the Day of the Russian Navy, recalled the threats that Russia is currently facing from a number of countries.