The Taliban on Tuesday released two hostages who had been held for three years in exchange for the Afghan government’s release of three imprisoned rebel commanders, the government and insurgent officials said.

American Kevin King and Australian Timothy Weeks, both professors teaching English at American University of Kabul, were kidnapped in 2016 near the campus. The three rebels were identified as Mali Kahn, Hafiz Rashid and Anas Haqqani, senior commanders in the Haqqani network based in Pakistan’s tribal areas near the Afghan border, who were captured between 2011 and 2014 and held at Bagram air base. The Taliban also said they released 10 members of the Afghan security forces but that has yet to be confirmed by the Afghan government.

“We are so happy to hear that my brother has been freed and is on his way home to us,” King’s sister, Stephanie Miller, said in a statement issued by the Trump administration. “This has been a long and painful ordeal for our entire family.”

The exchange, which was delayed after attacks on an American convoy and a suicide car bombing, was brokered by U.S. peace envoy Zalmay Khalilzad, who had earlier crafted a subsequently scuttled peace deal that would have engineered the withdrawal of U.S. troops.

Afghan President Ashraf Ghani announced plans for the swap last week as a first step in restarting peace talks, which broke down in September after U.S. President Trump canceled a Camp David meeting with Taliban negotiators. The Taliban said they would stand by the terms of Khalilzad’s original deal.

The prisoner swap took place in the southern province of Zabul and was accompanied by a 48-hour ceasefire. Ghani set a ceasefire as a condition before peace talks could be restarted.

“The release has happened, but we are not allowed to talk about it or give any details beyond this, as it is a big issue,” an Afghan official told the Washington Post. Taliban spokesman Zabiullah Mujahid confirmed the statement, adding: “All these measures are good progress for building … goodwill and can aid the peace process.”

The release followed a discussion among Ghani, U.S. Secretary of State Mike Pompeo and national security adviser Robert O’Brien late Monday to review swap arrangements, the Afghan presidential palace said in a statement.

“The U.S. officials reiterated their support for President Ghani’s decision and committed to work closely together to respond to any possible Taliban violence in the event the group doesn’t respond in good faith,” the statement said.

The three rebels were flown to Doha, Qatar, after Weeks and King were released, a senior Trump administration official said.