TO GO WITH AFP STORY "Pakistan-vote-India-peace" by Charlie McDonald-Gibson In this picture taken on February 20, 2008 at the Wagah border post with India, some 30 km from Lahore, Pakistani honour guards (black uniforms) and Indian rangers (background) take part in the daily flag-lowering ceremony.  Every evening as dusk falls on the India-Pakistan border post near Lahore, crowds gather on either side of the frontier and scream slogans at each other in a choreographed show of bravado. India on February 20 welcomed the elections in Pakistan and said it hoped to see fresh talks with its nuclear-armed South Asian rival.           AFP PHOTO/LIU Jin (Photo credit should read LIU JIN/AFP/Getty Images)
LIU JIN/AFP/Getty Images
TO GO WITH AFP STORY "Pakistan-vote-India-peace" by Charlie McDonald-Gibson In this picture taken on February 20, 2008 at the Wagah border post with India, some 30 km from Lahore, Pakistani honour guards (black uniforms) and Indian rangers (background) take part in the daily flag-lowering ceremony. Every evening as dusk falls on the India-Pakistan border post near Lahore, crowds gather on either side of the frontier and scream slogans at each other in a choreographed show of bravado. India on February 20 welcomed the elections in Pakistan and said it hoped to see fresh talks with its nuclear-armed South Asian rival. AFP PHOTO/LIU Jin (Photo credit should read LIU JIN/AFP/Getty Images)
Now playing
02:03
How the latest Kashmir crisis happened
Iran's new President-elect Ebrahim Raisi speaks during a press conference in Tehran, Iran, Monday, June 21, 2021. (AP Photo/Vahid Salemi)
Vahid Salemi/AP
Iran's new President-elect Ebrahim Raisi speaks during a press conference in Tehran, Iran, Monday, June 21, 2021. (AP Photo/Vahid Salemi)
Now playing
02:28
CNN asked Iran's President-Elect about nuclear deal. Hear his reply
Now playing
02:15
See where Olympians will eat, sleep and relax in Tokyo
TABRIZ, IRAN - JUNE 16: Iran presidential candidate Ebrahim Raeesi takes part in a campaign meeting with Residents of Tabriz on June 16, 2021 in Tabriz, Iran. The country's incumbent president, Hassan Rouhani, is ineligible to run again after serving two terms in office. (Photo by Meghdad Madadi ATPImages/Getty Images)
ATPImages/Getty Images Europe/Getty Images
TABRIZ, IRAN - JUNE 16: Iran presidential candidate Ebrahim Raeesi takes part in a campaign meeting with Residents of Tabriz on June 16, 2021 in Tabriz, Iran. The country's incumbent president, Hassan Rouhani, is ineligible to run again after serving two terms in office. (Photo by Meghdad Madadi ATPImages/Getty Images)
Now playing
02:20
Ultra-conservative candidate wins Iran's presidential election
nigeria kidnapping explainer africa Asher pkg oneworld intl ldn vpx_00021802.png
nigeria kidnapping explainer africa Asher pkg oneworld intl ldn vpx_00021802.png
Now playing
02:20
'The stuff of nightmares': Breaking down Nigeria's kidnapping epidemic
screengrab china shenzhou 12 launch
CCTV
screengrab china shenzhou 12 launch
Now playing
01:59
See Chinese rocket launch to send astronauts to its space station
Putin praises biden Geneva summit Robertson lkl intl hnk vpx_00010025.png
Putin praises biden Geneva summit Robertson lkl intl hnk vpx_00010025.png
Now playing
02:09
Hear Putin offer rare praise for President Biden
Iran presidential election Pleitgen pkg intl hnk vpx_00021422.png
Iran presidential election Pleitgen pkg intl hnk vpx_00021422.png
Now playing
02:22
Hear from Iranian voters as they head to polls in presidential election
Host TV
Now playing
07:15
'What are you so afraid of?': Journalist presses Putin on political opposition
Russian President Vladimir Putin faces questions from reporters after his meeting with US President Joe Biden in Geneva, Switzerland.
Host TV
Russian President Vladimir Putin faces questions from reporters after his meeting with US President Joe Biden in Geneva, Switzerland.
Now playing
04:44
Putin faces question about cyberattacks against the US
CNN's Christiane Amanpour provides analysis following a summit between President Joe Biden and Russian President Vladimir Putin.
CNN
CNN's Christiane Amanpour provides analysis following a summit between President Joe Biden and Russian President Vladimir Putin.
Now playing
01:59
Amanpour: Biden did something very different than Trump
President Joe Biden meets with Russian President Vladimir Putin, Wednesday, June 16, 2021, at the 'Villa la Grange', in Geneva, Switzerland.
Patrick Semansky/AP
President Joe Biden meets with Russian President Vladimir Putin, Wednesday, June 16, 2021, at the 'Villa la Grange', in Geneva, Switzerland.
Now playing
02:55
Ward describes 'uncomfortable' photo op between Biden and Putin
biden putin summit us russia press pools clash collins sot vpx_00012417.png
biden putin summit us russia press pools clash collins sot vpx_00012417.png
Now playing
01:40
Collins: 'Combative exchanges' between Russian and US press corps
Pool
Now playing
02:49
See Biden and Putin shake hands as summit begins in Geneva
GAZA CITY, GAZA - JUNE 15: Flames are seen after an Israeli air strike hit Hamas targets in Gaza City, Gaza on June 15, 2021. (Photo by Ali Jadallah/Anadolu Agency via Getty Images)
Ali Jadallah/Anadolu Agency/Getty Images
GAZA CITY, GAZA - JUNE 15: Flames are seen after an Israeli air strike hit Hamas targets in Gaza City, Gaza on June 15, 2021. (Photo by Ali Jadallah/Anadolu Agency via Getty Images)
Now playing
03:58
Israel launches airstrikes in Gaza over incendiary balloons
China successfully launched the first module of its planned space station from the Wenchang launch site in the southern island of Hainan, according to the China National Space Administration.
CCTV
China successfully launched the first module of its planned space station from the Wenchang launch site in the southern island of Hainan, according to the China National Space Administration.
Now playing
01:04
See China's last rocket launch to send in space key component of its space station
Islamabad CNN —  

The captured Indian pilot at the center of one of the gravest military crises in South Asia in years was released from Pakistani custody in a dramatic night-time handover at a border post between the two countries on Friday.

The pilot, identified as Wing Commander Abhinandan Varthaman, found himself at the center of soaring tensions between the nuclear-armed neighbors after his MiG-21 jet was downed during a dogfight between Pakistani and Indian warplanes over the ceasefire line in the disputed Kashmir region on Wednesday.

Dressed in a blue blazer and white shirt, a solemn-looking Varthaman was escorted by Fareeha Bugti, the director of the India desk in Pakistan’s Foreign Office and Pakistani soldiers to the Wagah border crossing between the two countries as cameras rolled on Friday. After passing through the border gate and into India, he was ushered away by Indian forces.

Troops lined both sides of the crossing ahead of the handover, which was delayed by several hours for unknown reasons. Hundreds of people amassed on the Indian side of the border in the afternoon, drumming, dancing and waving the Indian national flag in anticipation of the pilot’s return.

One of Varthaman’s first stops was for a medical checkup, RGK Kapoor, Air Vice Marshal of the Indian Air Force told the media moments after the handover.

“This checkup is mandated particularly because the officer has had to eject from an airplane which would have put his entire body under great stress,” Kapoor said. “IAF (Indian Air Force) is happy to have him back.”

Local TV stations carried live shots of the pilot being taken to a military hospital in the capital late on Friday night.

Earlier Friday, the Pakistani foreign ministry said Varthaman “was treated with dignity and in line with international law” during his several days in captivity.

Pakistani Prime Minister Imran Khan has described the release of the pilot as a “gesture for peace” in an attempt to defuse the spiraling crisis between the two countries.

Indian Prime Minister Narendra Modi sent well-wishes to the pilot after the handover in a post on Twitter.

“Welcome home Wing Commander Abhinandan! The nation is very proud of your exemplary courage,” he tweeted Friday.

Modi added that India’s armed forces were an “inspiration” to its 1.3 billion citizens.

Despite the gesture, Indian officials have so far remained guarded. India’s Minister of State for External Affairs, Vijay Kumar Singh, said Pakistan “has not done us a favor” by adhering to the Geneva Conventions and returning its pilot.

In a written statement on his Twitter account, Singh said India welcomed the move, but that “it is the first of many steps that #Pakistan must take to reinforce their commitment to peace.”

Tensions in Kashmir

The stand-off has seen both sides engage in increased military exchanges across the heavily fortified Kashmir border. At least four Pakistani civilians have died and eight were injured in cross-border shelling from India since Thursday night in several areas in Pakistani-controlled Kashmir, Raja Moazzam, Pakistan state director for disaster management, told CNN Friday.

Moazzam said dozens of houses have been damaged from shelling and hundreds of people have been moved to other areas. About 600 people are taking shelter in state-run camps, he said.

India has accused Pakistan of initiating the exchange of fire.

Speaking with CNN’s Christiane Amanpour on Thursday, Pakistan’s foreign minister, Shah Mehmood Qureshi, said that the release of the pilot should be seen as an expression of his country’s willingness to de-escalate.

He also confirmed that Masood Azhar, leader of the Jaish-e-Mohammed militant group that India said it targeted in its pre-dawn strike in Pakistan territory on Tuesday, is in Pakistan. “He is very unwell,” Qureshi said. “He is unwell to the extent that he cannot leave his house, because he is really unwell, so that’s the information I have.”

Pakistani Rangers and Indian Border Security Force personnel fold their respective national flags as they perform during the daily beating of the retreat ceremony on the India-Pakistan Border at Wagah on February 20, 2017.
NARINDER NANU/AFP/AFP/Getty Images
Pakistani Rangers and Indian Border Security Force personnel fold their respective national flags as they perform during the daily beating of the retreat ceremony on the India-Pakistan Border at Wagah on February 20, 2017.

Differing narratives

In what has become a hallmark of the crisis, the two sides have stood by differing accounts of what occurred in the skies over Kashmir.

On Wednesday, Pakistan said its air force shot down two Indian fighter jets. India confirmed the loss of one plane and said it shot down a Pakistani jet as it responded to the incident.

Indian military officials accused Pakistan of “factually incorrect statements” on its plane shootings and intentionally targeting military installations. Pakistan said it dropped weapons in open space where there was no human presence or military posts.

The Wagah border crossing, where the pilot was handed over, is known for its daily parade called the “beating retreat” ceremony. But Indian Border Security Force (BSF) spokesperson Subhendu Bhardwaj told CNN on Friday the parade has been canceled on the Indian side.

Every evening there for 60 years, Pakistan’s Rangers and India’s Border Security Force take part in a lowering-of-the-flags ceremony before sunset.

The ceremony, which ends with soldiers folding their countries’ flags and shaking hands, draws attendees from both sides of the border, as well as international tourists.

Simmering resentment

The immediate trigger for the latest confrontation was a suicide car bomb attack on February 14 in Indian-controlled Kashmir, which killed 40 Indian paramilitary soldiers. India blamed the terrorist group Jaish-e-Mohammed for the attack, the deadliest on security forces since the beginning of the insurgency in the late 1980s.

“The world is watching our collective will. We trust our army’s capability and because of this, it is extremely necessary that nothing should happen that harms their morale or that our enemies should get a chance to raise a finger against us,” Modi said Thursday.

After the February 14 attack, Modi expressed “deep anger” and promised that those responsible would pay a heavy price.

Modi’s comments on the escalating crisis along the border in disputed Kashmir were in stark contrast to Pakistani leader Imran Khan, who called for dialogue between the two sides.

Speaking in a national address Wednesday, Khan said that any further escalation between the countries would be beyond the two leaders’ control. He warned that because India and Pakistan had nuclear weapons, the stakes were too high for any “miscalculation” in conflict.

“World history tells us that there are miscalculations in wars. But my question to the Indian government is: Given the arms that we and you have, can we afford any miscalculation?” he said. “It will neither be in my control, nor in the control of (Indian Prime Minister) Narendra Modi.”

CNN’s Swati Gupta and Adeel Raja contributed to this report.