* Kandahar deaths prompt ISAF letter to Karzai
* ISAF forces to be retrained in avoiding civilian deaths
* NATO commander expresses personal sadness at deaths (Recasts with comment from NATO force)
KABUL, Nov 29 (Reuters) - The commander of NATO-led forces in Afghanistan has promised the Afghan president his entire force will be retrained immediately after recent civilian deaths during coalition operations, officials from both sides said on Tuesday.
Civilian casualties are a major source of friction between Afghan President Hamid Karzai's government and its Western backers. Rules governing air strikes and "night raids" have been tightened several times in recent years, but such operations can still go wrong.
NATO forces angered Islamabad and tested an already uneasy alliance when an attack killed 24 Pakistani soldiers at the weekend. NATO described it as a "tragic, unintended incident".
The NATO-led International Security Assistance Force (ISAF) in Kabul confirmed ISAF commander U.S. General John Allen had written to Karzai in response to civilian deaths in volatile Kandahar province in Afghanistan's south last week.
"It is the highest interest of ISAF to protect the civilian population," senior ISAF spokesman Carsten Jacobson said.
"The commander of ISAF immediately after the incident took action in his orders to his commanders. Retraining of the entire force in all the relevant and long-existing orders has been ordered," Jacobson told reporters.
Karzai ordered an investigation on Thursday into an air attack by NATO forces in southern Afghanistan that killed six children and an adult.
Jacobson said two other incidents in Kandahar, one involving the deaths of two motorcyclists and another in which the Kandahar governor's office said three women and two children were killed in a rocket attack on Sunday, were also under investigation.
Earlier on Tuesday, Karzai's office said in an emailed statement Allen had expressed his "personal sadness" over recent civilian deaths. That statement also confirmed Allen's directive to retrain ISAF troops, who number about 130,000.
"I have issued direct orders for all units to conduct retraining on our methods of employing force against insurgents while protecting Afghan civilians," the president's office quoted Allen as saying in the letter.
"No later than 5 December, units will confirm to me that they have complied with these orders," it said. (Reporting by Jan Harvey; Editing by Paul Tait)