Pakistan has unveiled a locally built submarine in the southern port city of Karachi. But somewhat surprisingly, President Pervez Musharraf said the biggest threat to Pakistan comes not from outside, but from home-grown religious extremism.

The Agosta 90-B is Pakistan's second submarine built with the help of French engineers. Navy officials say it is capable of launching anti-ship missiles and various types of torpedoes. They say the submarine is fitted with the most modern command and control systems and can dive below 300 meters.

Speaking at the commissioning ceremony in Karachi Friday, President Musharraf said the submarine, named Saad, will strengthen Pakistan's defense capabilities.

"Pakistan follows a strategy of deterrence through an offensive defense strategy," he said. "And I must say that induction of Saad reinforces our strategy of deterrence."

The bulk of Pakistan's deterrence has traditionally been directed towards its neighbor, India, with whom it has fought three wars.

But the Pakistani president said the main danger to his country does not come from outside. He described sectarian and religious terrorism as Pakistan's greatest threat. This menace of extremism, President Musharraf said, is eating the Pakistani nation "like termites".

Pakistan recently banned six radical Islamic groups as part of efforts to curb religious extremism in the country. Some of these groups allegedly have ties with the al-Qaida terror network and are blamed for a wave of violence aimed at Western and Christian targets in Pakistan.

Mr. Musharraf's comments are made during a gradual improvement of relations between India and Pakistan. The two countries came close to another war last year over the disputed territory of Kashmir, but since then they have taken steps to normalize their relationship.

They have restored full diplomatic ties and resumed a cross-border bus service. Talks to restore train service between the two countries are due next week, and air links will restart on January 1.

As another hopeful sign, Indian Prime Minister Atal Behari Vajpayee has agreed to attend a regional summit early next month in Pakistan.