The clips, which carried the official seal of the American Embassy in Islamabad, were broadcast in English and subtitled in Urdu, the national language.
The failure of the police to stop demonstrators from assembling near the American Embassy and other diplomatic missions left the government scrambling. Its ministers blamed opposition political parties and banned militant groups for instigating unrest.
The State Department issued a travel warning advising Americans to avoid travel to Pakistan.
Some viewers had a lukewarm response to the American ads.
A security analyst based in Karachi, Pakistan, who spoke on the condition of anonymity, said, “The messages do not matter because all those instigating or supporting the protests benefit from the publicity of the protest.”
Rao Zahid, 30, a government employee in Islamabad, said: “The video message is a cover-up. Google did not ban the video in America. No case was registered against the producer. If the American government wanted, it could have done a lot.” In Los Angeles on Thursday, a judge refused to order YouTube — which is owned by Google — to remove the video.
At least one person here said he liked the embassy message. “I liked that they expressed their sorrow and they were sorry for the video,” Ghalib Khalil, 17, said. “Also, they reminded people that Islam is a religion of peace and not of killing and violence.”
In a move seen as an effort to tap into public discontent, and widely described by analysts as politically motivated, the ruling Pakistan People’s Party has declared Friday a public holiday called “Love for Prophet Day.”
Prime Minister Raja Pervez Ashraf is scheduled to address a gathering of religious scholars in Islamabad on Friday morning. Government ministers have urged people to protest, albeit peacefully.
“The government was trying to seize the political initiative by owning the protest movement,” said Raza Rumi, a director at the Jinnah Institute, an Islamabad public policy group. “Essentially it has decided to join the bandwagon. Everyone wants to be a part of the populist cause.”
Mr. Rumi warned that the strategy could backfire if it appeared that the government was capitulating to extremists.
On Thursday, a stretch of road outside the five-star Serena Hotel, near the entrance to the diplomatic quarter, turned into a battlefield between riot police officers and a crowd of protesters estimated to be between 8,000 and 10,000. The police charged with their batons and fired tear gas canisters; protesters fought back with sticks and iron rods, set a police checkpoint on fire and hurled stones into the hotel. Dozens of vehicles in the parking lot were damaged, leaving anxious guests stranded inside.
Army troops were put on standby, but as evening approached negotiations between police officials and religious leaders succeeded in dispersing the crowds.
Rehman Malik, the interior minister, said the crowd included activists from the banned groups Lashkar-e-Jhangvi and Sipah-e-Sahaba Pakistan. Qamar Zaman Kaira, the information minister, said they had been encouraged by the opposition Pakistan Muslim League-Nawaz party.
Pervez Rashid, a member of that party, denied the assertion. “Once the protesters enter Islamabad, it is the responsibility of the federal government to maintain law and order,” he said.