In Ghazni Province, a group of 17 Afghan policemen who had just been trained by Americans were drugged into comatose stupors by comrades, described after the episode as Taliban infiltrators, while on duty. They were then shot to death in what appeared to be the single worst episode in a string of similar attacks, according to Afghan officials and an insurgent spokesman.

In Kandahar Province, three policemen were killed in what the Taliban said was an attack carried out by one of its supporters, although police officials attributed the killings to a relative of one of the victims.

The Ghazni attack took place at a remote Afghan Local Police outpost in Habib Godala village in the Andar district at about 1 a.m., according to Gen. Zrawar Zahid, the Ghazni police chief.

Other Afghan officials said the authorities had already arrested two policemen, described as Taliban infiltrators who had carried out the attack. The attackers poisoned the dinner food of the other officers, shot them at close range to ensure they were dead, stole their weapons and fled after setting a police vehicle on fire.

General Zahid said that 10 of the victims were Afghan Local Police officers who had finished their training, and the other seven were recruits who had been undergoing training.

The Afghan Local Police program has been contentious in many parts of Afghanistan because of prominent insider attacks as well as accusations of human rights violations by the policemen.

The local police officers are vetted and trained under the supervision of American Special Operations troops as self-defense forces for their own communities and sometimes include groups of armed men who had formerly sided with the Taliban.

This unit, which was completely wiped out by the attack, had been trained by the Americans at a base in the Andar district center a month ago, according to local officials. Only a week earlier, there was another similar effort to drug policemen in that district, but the drug had not been strong enough and the victims were able to escape an attack, according to Khalil Hotaki, head of a peace group in Ghazni.

"We have repeatedly warned the A.L.P. recruiters and trainers to conduct proper and accurate vetting processes for people who want to join the A.L.P. ranks," said Fiazanullah Fiazan, a former provincial governor in Ghazni. "We have told them not to enroll unknown people or people who are not vouched by tribal elders, but they don't listen. They are trying to meet the recruiting deadline and get credit for it."

A spokesman for the Special Operation troops in Afghanistan could not be reached for comment. A spokesman for the NATO-led International Security Assistance Force referred all questions to Afghan officials.

A spokesman for the Taliban, Zabiullah Mujahid, e-mailed a statement to journalists claiming responsibility for the attack.

"Locals in the area were tired of the atrocities and crimes of these arbakais and their lives and property were not safe," Mr. Mujahid wrote, using the Afghan term for irregular militias. The deaths of the police officers, he said, meant that "oppression has been weakened and decreased in the area."

In the Kandahar episode, the authorities said the bodies of three National Police officers were found outside their police post on the outskirts of Kandahar City, shot to death. A spokesman for the police, Ghorzang, who like many Afghans goes by only one name, said the attacker was not an insurgent, but a heroin addict and a relative of the post commander, who was one of the victims.

Mr. Ghorzang said the commander had taken the relative to get treatment, and after the police in the post fell asleep he took one of their guns and killed him and two other officers. The attacker, who was not identified by name, escaped.

But a spokesman for the Taliban in southern Afghanistan, Qari Yousuf Ahmadi, reached by telephone, said that the insurgents had recruited the attacker and took responsibility for the attack.

The attacks were just the latest in a series of such insider attacks, often involving the use of poisons or drugs to subdue other policemen, who are then shot while unconscious. Typically, rat poison is used but the victims are shot as well because the poison is not always fatal when delivered in food.

"This type of attack is so deadly and disastrous, both in terms of loss of human life and in critically undermining trust and confidence among the Afghan national security forces and in particular the A.L.P.," said retired Gen. Atiqullah Amarkhel, an Afghan military analyst. "We have a large number of cases similar to last night's attack in Ghazni."

In January, an Afghan Local Police officer killed his commander and several colleagues in that manner, in Panjwai District of Kandahar Province. In a 10-day-long period in December, there were at least three such attacks by local policemen or others, resulting in 17 deaths.

Taimoor Shah contributed reporting from Kandahar, and Sangar Rahimi and another Afghan employee of The New York Times from Kabul.