Image copyright Reuters Image caption Mr Sharif has faced weeks of anti-government protests

Pakistan's Prime Minister Nawaz Sharif has visited the tribal area of North Waziristan to tell soldiers they are winning the "war against terrorism".

Mr Sharif is the first elected head of government to tour the area, a former militant bastion, for nearly 20 years.

Accompanied by the army chief, he described an anti-Taliban offensive which began in June as a war for the survival of Pakistan.

The surprise trip follows weeks of protests which have weakened Mr Sharif.

No elected leader of a Pakistani government has been to the lawless North Waziristan region since US-led forces ousted the Taliban from power in neighbouring Afghanistan in late 2001. Benazir Bhutto was the last prime minister to visit in 1996.

'Successful war'

Addressing troops in the town of Miranshah, Mr Sharif had nothing but praise for army chief Gen Raheel Sharif.

"We are winning this war, and I am certain that God willing, Pakistan will become a peaceful country. For this I want to pay a special tribute to General Raheel, who is your army chief.

"This war - which is a war for the survival of Pakistan, a war for making Pakistan's future secure - is being fought under his leadership with great success. The entire nation is satisfied with this and happy about it," the prime minister said.

Image copyright Reuters Image caption Pakistani soldiers have taken Miranshah and other main towns under their control

Pakistan's army says it has killed more than 1,000 militants in the offensive so far, although the claim cannot be independently verified. The military itself admits that many insurgents may have learnt of the assault in time to escape.

The BBC's M Ilyas Khan in Islamabad says Mr Sharif's visit is being seen by some as an attempt by Pakistan's military and civilian leadership to display unity.

Others suggest it shows that politicians, and to a lesser extent the military, have agreed to change their position on crucial policy issues, our correspondent says.

Some in the military are unhappy at Mr Sharif's decision to put Pervez Musharraf, the former army chief and president who ousted him in 1999, on trial for treason - while many Pakistanis believe elements in the military are orchestrating the continuing anti-government protests.

Mr Sharif won general elections last year pledging to normalise relations with India and to hold peace talks with the Pakistani Taliban.

Neither promise has been kept.

Peace talks collapsed after militants attacked Karachi airport in June and the military, which had opposed the process, launched its long-awaited offensive. Relations with India are as low as they have been in a decade following recent border clashes.