"Security is our top priority," Modi told thousands packed into the landmark Red Fort in New Delhi on Tuesday as India marked the 70th anniversary of the end of British colonial rule.
"Be it the sea or the borders, cyber or space -- in all spheres, India is capable and we are strong enough to overcome those who try to act against our country," the Hindu nationalist leader declared.
Modi, who wore a Rajasthani turban with a long flowing orange train, toned down his comments from three previous Independence Day speeches and did not mention the targets of his warning.
But his remarks came as a dispute between India and China over a strategic Himalayan plateau enters a third month on Wednesday. Hundreds of soldiers are reported to be facing off against each other at Doklam.
The giant neighbours share a long history of mistrust and went to war in 1962 over the Indian state of Arunachal Pradesh.
China's state-controlled media has repeatedly warned that a conflict could break out over Doklam.
India has urged a diplomatic solution to the standoff. The dispute started on June 16 when Chinese troops started to build a road on territory that it disputes with Bhutan. India troops moved in to stop the construction as India is a close ally of Bhutan.
India is also mired in conflict in the Himalayan region of Kashmir, where it has disputed sovereignty with Pakistan since their bitter split in 1947.
India accuses Pakistan of sending "terrorists" across the border to fight security forces in Indian-administered Kashmir.
Modi, who said he spoke with US President Donald Trump on the eve of the speech, said: "The concern for national security is a natural one in an independent India.
- 'Surgical' power -
"Our security forces have always shown their capabilities whenever on duty. Whether it is terrorism or infiltrators, our security personnel have always been ready for sacrifice."
India carried out what it called "surgical strikes" in Pakistan in September last year after insurgents attacked an army base on the Indian side of the Kashmir border, killing 18 soldiers.
"When the surgical strike was carried out, the world came to know about the power that India possesses," Modi said in his speech.
He added that "bullets and abuses" cannot bring peace in Kashmir -- where there are an estimated 500,000 Indian troops -- but also accused Kashmiri separatists of "scheming".
The prime minister did not mention the 1947 partition that saw the creation of Muslim-dominated Pakistan and Hindu-majority India. At least one million people died in the chaotic aftermath of the split and 15 million were uprooted in the brutal mass migration.
Modi focused his comments on efforts to clamp down on corruption and his economic reforms. A year ago, a government move to cancel more than 85 percent of India's banknotes caused widespread chaos.
He said the move had brought $46 billion of currency into the legitimate banking system.
More than 300,000 "shell companies" funded by undeclared finance had been uncovered through irregular transactions. The licenses of more than 100,000 of the firms have been cancelled, he added.
According to Modi, 1.8 million people have been found whose income outstrips their declared wealth. About 450,000 have admitted their "mistakes," the prime minister added.
"India is celebrating honesty today. The corrupt have no place to hide anymore," Modi said.