Gordon Brown has vowed to "step up" efforts to defeat terrorism in Pakistan in the wake of opposition leader Benazir Bhutto's assassination.
The prime minister also revealed he had spoken with US President George Bush and Australia's new Prime Minister Kevin Rudd.
He pledged they would defeat terrorists who were trying to "thwart democracy".
Mr Brown added he had called Pakistan's President Musharraf to urge him to hold elections as planned in the new year.
He spoke as thousands of British Muslims gathered in mosques across the country to pray for Ms Bhutto.
The prime minister said: "What's important is that those terrorists who have tried to bomb, kill and maim their way to stop democracy in Pakistan are not successful."
Mr Brown added the legacy of Ms Bhutto's death should not be that elections are cancelled but that "democracy is sustained and promoted in Pakistan".
"It is clear that we must take immediate action and we will give whatever help we can," he said.
"At every point terrorism must be fought and we will win here, there and everywhere in the fight against terrorism."
Mr Brown also offered condolences to President Musharraf on behalf of the British people and told him they shared the "shock and anger" at the assassination.
He said: "I talked to President Musharraf about the feelings of the British people, their shock at the tragic assassination of Benazir Bhutto.
More than 3,000 people turned out to pay their respects at the Birmingham Central Mosque.
And about 1,000 worshippers attended a service in Bradford, which was a major support base for Ms Bhutto's political party, the Pakistan People's Party (PPP).
Worshippers paid tribute as Ms Bhutto was laid to rest in her family's ancestral village, Sindh.
Outside Birmingham mosque, Afsar Khan, 43, said: "I was really shocked yesterday when I heard the news. It's like when Princess Diana died - I will always remember where I was when Benazir Bhutto died."
Fellow worshipper Mohammad Bashir said: "Benazir Bhutto is a world-class statesman who was renowned throughout the world, not just in Pakistan.
"She was a very charismatic personality and intellectual character. Most people have been in contact with their loved ones in Pakistan and have been trying to find out what the latest position is."
The Foreign Office has warned Britons not to travel to Pakistan and those already there are being told to stay indoors as violence erupted in the country.
Travel agents have been refunding tickets to people who had planned to visit the country over the new year period.
One told BBC News: "No one is going to Pakistan, tickets are being refunded. The shops are closed and no one is outside. People are scared."
In Bradford, the Council of Mosques spokesman Ishtiaq Ahmed said: "The murder of Benazir Bhutto is a major setback to restoring democracy in Pakistan.
"The country, presently in the clutches of the military, is being held at ransom by anti-democratic and terrorist forces."
Shadow business secretary Alan Duncan, who was a friend of Ms Bhutto's for more than 30 years since they met at Oxford University, said her death was a "stab in the heart of democracy".
He added: "I was in e-mail contact with her only a couple of days ago. This is a disaster for Pakistan and a tragic end to the life of a most courageous politician."