In a speech at a rally in Islamabad, Imran Khan said his country will give a "befitting response" to the government of Indian Prime Minister Narendra Modi if it attacked.
"Every brick will be countered with a stone," he said. "Our armed forces are ready" to respond to any such attack, he said.
Khan said any conflict between nuclear-armed Pakistan and India will not be confined to the South Asian region. "The whole world will be affected" because of it, he said, adding that he will raise the issue when he addresses the U.N. General Assembly next month.
Khan said that people in Indian-administered Kashmir were living under curfew for almost four weeks since New Delhi downgraded Kashmir's autonomy on Aug. 5 and imposed a security clampdown to prevent any violence.
Khan assured his government's full support to Kashmiri people and said he hoped that Indian-administered Kashmir will soon get independence.
He described Modi as a "fascist" and equated him with Adolf Hitler, saying he feared a "genocide of Muslims in Kashmir." He said Modi had played his "last card" by downgrading the special status of Kashmir.
India on Thursday said it has information that Pakistan is trying to infiltrate "terrorists" into the country. Pakistan's army spokesman Maj. Gen. Ghafoor rejected the Indian claims, saying Pakistan was a responsible state and "we would be insane to allow infiltration" across the Line of Control.
Friday's rallies were held in almost all cities, towns and villages in Pakistan and Pakistani-controlled Kashmir to express solidarity with Kashmiris in the Indian-held portion. Protesters in the eastern city of Lahore and elsewhere burned Indian flags and effigies of Modi.
The rallies came a day after Pakistan's military announced that it successfully test-fired a missile capable of carrying nuclear warheads up to 290 kilometers (about 180 miles). The two neighbors have fought two of their three wars over the Himalayan region since they gained independence from British colonial rule in 1947.
They went close to the war again in February, when a suicide bombing in Indian-administered Kashmir killed 40 paramilitary soldiers. India responded by bombing an alleged militant training camp in Pakistan. Pakistan then claimed it shot down two Indian air force planes and captured an Indian pilot who was later released.
India often accuses Pakistan of training and arming insurgent groups that have been fighting since 1989 for Kashmir's independence from India or its merger with Pakistan, a charge Islamabad denies.
Pakistan says it only provides moral and diplomatic support to these groups.
Most Kashmiris support the rebels' demand that the territory be united either under Pakistani rule or as an independent country, while also participating in civilian street protests against Indian control.