U.S. military deaths in Iraq plunged by two-thirds in 2008 from the previous year, a reflection of the improving security following the U.S. military's counterinsurgency campaign and Al Qaeda's slow retreat from the battlefield.

By comparison, the war in Afghanistan saw American military deaths rise by 35 percent in 2008 as Islamic extremists shift their focus to a new front with the West.

According to a tally by The Associated Press, at least 314 U.S. soldiers died in Iraq in 2008, down from 904 in the previous year. In all, at least 4,221 U.S. soldiers have died in Iraq since the war began in 2003.

For Iraqis, the plunge was also marked; During 2008, at least 7,496 Iraqis died in war-related violence according to an AP count, including 6,068 civilians and 1,428 security personnel, down 60 percent from 2007.

The Associated Press tally does not reflect a comprehensive total for Iraqi deaths because reports do not come in from all of the country. The estimate, however, has proven accurate for tracking trends.

In Afghanistan, 151 U.S. soldiers died in 2008, compared with 111 in the previous year, according to an AP tally. The count recorded 1,160 civilians killed in insurgency-related violence, up from 875.

At least 625 U.S. soldiers have died because of the war in Afghanistan since the fighting began in 2001.

The AP count is based on figures from Afghan, U.S. and NATO officials.

The combined total of at least 465 U.S. deaths in both Iraq and Afghanistan for 2008 is the lowest combined total for both wars since 2003, when the U.S. invaded Iraq.

Many critics have said the U.S. focus on Iraq led it to neglect the war in Afghanistan, allowing both Al Qaeda and Taliban militants to regroup after being routed in 2001. The Taliban, in the last year, moved into wide swaths of Afghan countryside, where Afghan security forces or international troops don't operate. Military commanders in Baghdad say they have enough troops to win all battles but not enough to hold territory, or to keep remote villages safe.

Seth Jones, an analyst with the RAND Corp., said he thinks the insurgency is still quite weak because there is no central command structure and because it doesn't have the support of local Afghans. But levels of violence have increased because of the continuing use of sanctuaries by militant groups in Pakistan.

"I think the second issue is the ability of groups to move into a vacuum in significant parts in Afghanistan, including in the east and south, where the Afghan government simply has not been able protect villages in rural areas," Jones said.

The plunge in violence in Iraq follows the U.S. "surge" of 2007, when thousands of additional troops were sent in to try to rein in a country that appeared to be on the verge of disintegration. That was coupled with a counterinsurgency campaign that included a decision by Sunni tribesmen to switch allegiances and fight Al Qaeda. A focused effort to rout Shiite extremists gave U.S. and Iraqi forces the upper hand.

U.S. military spokesman Maj. Gen. David Perkins said recently that attacks in Iraq had declined to an average of 10 a day from 180 a year ago, and the murder rate in November was less than 1 per 100,000 people — far lower than many cities in the world.

The drop in violence has bolstered the Iraqi government's confidence as it takes what it calls full sovereignty of the country on Thursday. Under a new security agreement, Iraq will take the lead in security away from U.S. forces, regain control of its airspace, and take back the Green Zone, a wide area of downtown Baghdad that the U.S. occupied after its 2003 invasion.

But the deaths of two soldiers on the last day of the year underscored that significant violence persists. One soldier was killed by a mortar round in Baghdad and the other died from wound sustained in combat a day earlier in Tikrit, the military said.

Iraq remains gripped by hostility between Shiite and Sunni Muslims and disputes within the creeds.

Police announced Wednesday the arrest of a leading figure in a messianic Shiite cult that has battled Iraqi and U.S. forces, possibly thwarting plans by the group to carry out attacks against hundreds of thousands of pilgrims that will gather next week at one of Iraq's holiest shrines.

A top adviser to Prime Minister Nouri al-Maliki, Sadiq al-Rikabi, described Thursday as a "historic day" during which "the symbols of sovereignty, which are highly cherished by Iraqis, will be restored."

U.S. and Iraqi forces continue to battle Al Qaeda in Iraq and other insurgents in the north and in Mosul, the country's third-largest city, where economic and political problems persist. Eight people were killed Wednesday in four bombings in the north.

In the southern city of Basra, Police Chief Maj. Gen. Adil Dahham said his forces had arrested a leader of the "Soldiers of Heaven" cult that has carried out bloody attacks during the Shiite Ashura holiday in the past two years.