KABUL — Six Taliban prisoners accused of involvement in the killings of American, French and Australian nationals were released from Afghan custody on Thursday and flown to Doha, Qatar, according to two Afghan officials, paving the way for formal peace talks between the Taliban and the Afghan government to begin in the coming days.

The high-value prisoners will be placed under temporary house arrest, according the two officials, who spoke on the condition of anonymity because they were not authorized to speak to the media.

Secretary of State Mike Pompeo will travel to Doha for the talks, President Trump said during a news conference Thursday, adding that “we’re getting along very, very well with the Taliban and very well with Afghanistan.”

The talks are a key foreign policy objective for the Trump administration as it looks to withdraw U.S. troops from the country.

Afghan President Ashraf Ghani “wishes success to the negotiating team of the Government of the Islamic Republic of Afghanistan for achieving lasting peace and stability in the country, which is the long-standing desire of our people,” the presidential palace said in a Twitter statement. Afghan presidential spokesman Sediq Sediqqi said in a tweet that the country’s negotiating team will travel to Doha on Friday.

Following the arrival of the prisoners in Doha, the Taliban announced that it was ready to begin official, direct peace talks with the Afghan government. Taliban spokesman Muhammad Naeem Wardak said in a tweet that the initial meeting would be held Saturday in Doha.

The announcements follow six months of delays, most recently over a handful of high-value Taliban prisoners accused of killing American, French and Australian nationals.

The talks were mandated by the deal signed by the United States and the Taliban in February and were to have begun in March. Political turmoil in Kabul and escalating violence countrywide have also contributed to delays.

The Trump administration has applied pressure to both the Afghan government and the Taliban to begin talks immediately. Despite objections from U.S. allies to the transfer of the men accused of killing the foreign nationals, U.S. officials did not raise formal concerns.

The six men who landed in Doha are the last of thousands of Taliban inmates released by the Afghan government in a prisoner swap process that was the central issue delaying peace talks for months. The U.S.-Taliban deal called for the Afghan government to release 5,000 Taliban fighters in exchange for 1,000 members of their security forces.

In Doha, the six prisoners will be kept under house arrest through November, after which their stay could be extended or they could be returned to Afghanistan, according to one of the two Afghan officials. It is unclear if the prisoners would be placed under house arrest if returned to Afghanistan or if they would be set free like thousands of other Taliban fighters, the same official said.

Initially, French and Australian objections to the temporary nature of the house arrest scuttled a plan to transfer the men earlier this week, according to the first Afghan official.

The prisoners were issued restricted passports for the trip and a chartered plane was scheduled to fly from Doha to Kabul on Sunday to collect them. Airspace permissions had been obtained, but the operation was put on hold that day and the plane never left Doha, the official said. French and Australian officials later agreed to the transfer after an option to extend the house arrest was added into the deal, the official said.

Launching official, direct negotiations is one of the few demands of the deal signed between the United States and the Taliban, which sets a timeline for the full withdrawal of U.S. forces. The deal also calls on the Taliban to pledge to cut ties with international terrorist groups. Despite concerns that the group is not upholding that pledge, President Trump is pushing for further troop reductions.

The top American commander in the Middle East, Gen. Kenneth “Frank” McKenzie Jr., said Monday that troop levels in Afghanistan would drop to 4,500 by November.

Three of the six prisoners transferred to Doha are accused of involvement in what are known as insider attacks against U.S. troops. The assaults, conducted by Taliban infiltrators of the Afghan security forces against foreign forces, sowed deep distrust and undermined the U.S.-led military and training missions there.

The launch of talks also comes just days after an unexpected shake-up within the Taliban’s negotiating team. A Taliban spokesman announced Saturday night that Chief Justice Abdul Hakim would replace Sher Mohammad Abbas Stanikzai as the lead negotiator. Hakim’s background in Islamic jurisprudence is thought to make him a more successful negotiator on issues of Islamic law, which are expected to play a prominent role in the talks.

Haq Nawaz Khan in Peshawar, Pakistan, contributed reporting.