The Taliban have agreed to free 19 South Koreans kidnapped in central Afghanistan more than a month ago, both sides said today.

A Taliban spokesman, Qari Yousef Ahmadi, said representatives from the group and the South Korean government reached a deal over the release of the Christian aid workers during talks today in the central Afghan town of Ghazni.

In Seoul, a spokesman for the South Korean president's office, Cheon Ho-sun, confirmed a deal had been reached. "We welcome the agreement to release 19 South Koreans," he said.

The deal was reached after South Korea agreed to end all religious activities in Afghanistan and promised it would withdraw troops by the end of the year, according to the AFP news agency, citing Taliban sources.

Two men among the original group of 23 South Koreans, who were seized on July 19 while travelling on a bus on the main road between Kabul and Kandahar, were shot dead by their captors soon after being held. The only two female captives were released.

The bullet-riddled body of the group's leader, Bae Hyung-kyu, a pastor, was found by a roadside six days after they were kidnapped. Just under a week later, the body of 29-year-old Shim Sung-min, a 29-year-old aid volunteer, was also discovered.

On both occasions, Taliban spokesmen said the men had been shot because the Afghan government failed to meet the group's demand for the release of Taliban prisoners.

In March, President Hamid Karzai approved a deal that saw five captive Taliban fighters freed for the release of Italian reporter Daniele Mastrogiacomo.

Mr Karzai, who was criticised by the US and European government over the exchange, called the trade a one-off deal.

· A suicide bomber blew himself up next to a group of Nato troops building a bridge in eastern Afghanistan today, killing three soldiers and wounding six others, the alliance said in a statement.

The bomber was also killed in the blast, the statement said. Nato did not disclose the nationalities of the victims or the exact location of the blast.

Most foreign troops in the east of the country are American. A Ministry of Defence spokeswoman said the nationality of the casualties was not yet clear.