Pakistan says it stopped an Indian submarine from entering its waters and toyed with the idea of sinking it.

The Pakistan Navy shared video and a photo to back up its claim on Monday, though it did not specify the exact location.

Tensions between the nuclear rivals spiked last week, with the countries engaging in an air battle and Pakistan capturing an Indian pilot.

A representative for the Indian Navy told Business Insider that India was still assessing the situation.

The Pakistan Navy on Tuesday said it had stopped an Indian submarine from entering its waters, just one week after tensions between the two nuclear rivals peaked in a dogfight over Kashmir.

In a Facebook post, the Pakistan Navy said it had "detected and blocked Indian Navy Submarine from entering into Pakistani waters."

Framing the incident as an act of aggression by India, the navy said it could have destroyed the Indian submarine but decided not to in the interest of peace.

Tensions had seemed to be easing between the two countries since an air battle last week above the disputed Kashmir region.

What the Pakistan Navy said was a file photo of the submarine alongside an image from the recent encounter. Pakistan Navy

Pakistan's navy also shared a video of the submarine, which it said was "deviously deployed" in the area as part of "a series of provocative actions against Pakistan."

A navy official told reporters on Tuesday that Pakistan did not target the submarine "keeping in view Pakistan's policy of peace." The person said a warning was "communicated" to the submarine, which then moved away. The official spoke anonymously to reporters and did not elaborate, NBC News reported.

The navy has not clarified whether it was defining Pakistan's waters by the 12-nautical-mile territorial-waters limit (22 kilometers, 13.8 miles) or the much larger 200-nautical-mile exclusive economic zone, Agence France-Presse reported.

Read more: If India and Pakistan have a 'limited' nuclear war, scientists say it could wreck Earth's climate and trigger global famine

A representative of the Indian Navy told Business Insider the navy was still assessing the situation and declined to make a statement.

Pakistan said the submarine encounter was the first such incident since 2016, when Pakistan said it "pushed" an Indian submarine away from its waters.

Tensions high between nuclear rivals

Tensions sharply rose between India and Pakistan — which both have nuclear arsenals — after a February 14 attack in Kashmir.

A terrorist group based in Pakistan claimed responsibility for the attack, which killed at least 40 Indian troops.

Last week the conflict escalated when the two countries shot each other's jets out of the sky and Pakistan captured an Indian pilot.

Pakistan returned him Friday in what it called a "peace gesture."

An Indian fighter pilot was returned after he was released from Pakistan's custody on Friday. Sky News/Business Insider

Read more: Indian fighter pilot returned by Pakistan after wild ordeal in which he was shot down over enemy territory and reportedly ate sensitive documents to keep them secret

At least 10 people have been killed in the past week as troops fired across Kashmir's Line of Control between the two countries, the Associated Press reported.

India has remained relatively silent during the conflict, though it welcomed the return of its pilot, and Indian Prime Minister Narendra Modi repeatedly emphasized the country's military strength.

Pakistani protesters burned an effigy of Indian Prime Minister Narendra Modi in Hyderabad, Pakistan, on Thursday. AP Photo/Pervez Masih

World powers urged caution between the two countries, which have fought three wars over the Kashmir region: in 1947, 1965, and 1999.

Kashmir has been divided between India and Pakistan since the two countries gained independence from British rule in 1947. Both countries claim the territory in its entirety.