Pakistan's President Pervez Musharraf and PM Shaukat Aziz have issued pledges on the country's independence day to defeat terrorism and extremists.
Prime minister Aziz also called for a resolution of the Kashmir dispute
President Musharraf urged citizens in a TV address to reject those who wanted "to drag Pakistan into darkness".
Mr Aziz said Pakistan would take on terror and defeat it "at all levels".
Pakistan is celebrating its 58th anniversary of independence on Sunday amid a renewed government crackdown on Islamic extremists.
President Musharraf said in his address: "I appeal to the nation to reject the retrogressive elements politically and socially as they are opposed to progress.
"The nation should reject elements who want to drag Pakistan into darkness."
Mr Aziz was attending a flag-raising ceremony in the capital, Islamabad.
He said: "We have to send a message to the world that our society rejects extremism and is united against it.
"We will fight a war against this danger to protect our independence and we will defeat it at every level."
Security is tight across the country amid fears of a backlash after President Musharraf launched a crackdown on extremists shortly after the London bomb attacks on 7 July.
Hundreds of suspected militants have been arrested across the country and a new move introduced to ban foreign students from attending religious schools, or madrassas.
At least one of the British suicide bombers was thought to have spent some time at a madrassa.
Both Mr Aziz and President Musharraf have survived assassination attempts in Pakistan in the past two years.
In his address, Mr Aziz also touched on Kashmir, the main point of dispute with neighbours India.
"Kashmir is a smouldering issue. Its resolution is inevitable for durable peace," he said.
Mr Aziz also defended Pakistan's firing of its first nuclear-capable cruise missile on Thursday.
"We will keep on harnessing our nuclear and missile capabilities in line with the changing situation. We will add to this prowess whatever is needed to keep a balance of power and peace," he said.
Pakistan and India achieved independence from Britain at the same time in 1947. India celebrates its independence day on Monday.