Celebrations are taking place across Pakistan to commemorate the 60th anniversary of independence from the UK and the creation of the country.
President Musharraf marked the anniversary by staunchly defending sovereignty and calling on the nation to unite against terrorism.
Pakistan is celebrating on Tuesday and India marks independence one day later.
The violent partition of 1947 saw 10 million people cross borders in one of history's largest mass migrations.
Fireworks lit up the sky and crowds filled the streets as clocks struck midnight in the capital, Islamabad.
Dawn then sounded with 21-gun salutes across the country and millions took to the streets on a national holiday.
Both President Pervez Musharraf and Prime Minister Shaukat Aziz launched strong defences of national sovereignty to mark the day.
In comments released by the state-run Associated Press of Pakistan, President Musharraf fiercely rejected allegations that his anti-terrorism platform was for the benefit of the US.
"We are not confronting terrorism for America, we are doing it for ourselves," he said.
"I see everything from Pakistan's point of view. Now if Pakistan's point of view suits America, all right."
Gen Musharraf denounced as "sabre-rattling" suggestions by some US politicians that America should use military force if necessary against al-Qaeda in Pakistan without Islamabad's consent.
"I am 200% sure that these [comments] are neither at official nor at government level," he said.
Gen Musharraf said al-Qaeda and other militant organisations using Pakistan's border areas posed a threat to the country that must be tackled.
"It is time that the entire nation rises against them," he said.
The president said that national elections this year would be free and fair, ensure economic stability and would be held in a free media environment.
Mr Aziz vowed to stop any "foreign power" from violating the country's borders as he attended a traditional flag-hoisting ceremony in Islamabad, adding that nuclear weapons were "symbols of our national honour".
Correspondents say that this year's celebrations have been more low-key than usual because of tighter security created by the threat from Islamic militants.
The mood was sombre and serious, with security forces on high alert after weeks of unrest and bloodshed.
The BBC's Dan Isaacs in Islamabad says that people who did attend celebrations were under no illusions that the months ahead are going to be turbulent.
Crowds waved flags and set off firecrackers in the capital, but spirits were dampened somewhat by a torrential downpour that quickly turned the streets and grass verges into a muddy swamp.
Later in the day a minute's silence commemorated the hundreds of thousands of people who died in rioting when Pakistan was carved out of British India.
To herald the celebrations in both countries, Pakistan allowed 134 Indian prisoners to return home on Monday, mostly fishermen or people who had strayed across the border.
India formally handed over 72 Pakistani prisoners on Tuesday as it prepared to mark its Independence Day.