A parked car bomb targeted a restaurant in a mostly Shiite neighborhood in Baghdad on Tuesday, killing three people and injuring at least six others.

A U.S. soldier also was killed Tuesday by small-arms fire in northern Baghdad, the military said.

The death raises to at least 25 the number of American troop deaths reported this month, up slightly from 23 recorded in August.

In all, at least 4,176 members of the U.S. military have died in the Iraq war since it began in March 2003, according to an Associated Press count.

The attacks occurred as the country's Sunnis marked the start of the Eid al-Fitr holiday, which ends the fasting month of Ramadan, by filling mosques in greater numbers than in previous years due to a drop in violence. The holiday begins Wednesday for Shiites in Iraq.

The car bomb exploded around 3 p.m. as customers were eating at a kebab restaurant in Karradah, a commercial neighborhood in eastern Baghdad, two police officers said, speaking on condition of anonymity because they were not authorized to speak to the press. Eight people were wounded in the bombing, said the officers.

Maj. Mark Cheadle, a spokesman for U.S. forces in Baghdad, confirmed that three Iraqi civilians were killed in the bombing but said only six people were wounded, including two members of the Iraqi security forces. There are often conflicting casualty tolls following bombings due to confusion in the aftermath.

Cheadle blamed al-Qaida in Iraq for the attack.

Violence has fallen sharply overall in Iraq over the past year, although a string of attacks have marred Ramadan.

"I'm not optimistic at all about our future," said Ahmed Salam, a 28-year-old waiter who heard the explosion as he was on his way to work. "I think all the officials are liars who are trying to betray us with good words on the improved security situation."

Many Sunni worshippers, however, voiced optimism as they filled mosques at dawn and visited the graves of loved ones to begin the three-day festival marking the end of the holy month.

In Baghdad's northern Sunni neighborhood of Azamiyah, about 15,000 worshippers gathered at sunrise in the revered Sunni shrine of Abu Hanifa as U.S.-backed Sunni security forces known as Sons of Iraq stood guard at the shrine and a nearby cemetery.

"We are happy that we can leave our houses to perform prayers and visit our late beloved ones as we were not able to do so in the past," said Umm Ammar, a 54-year old resident of Azamiyah who attended the early morning ceremony. "We pray to God that we will keep living in such an atmosphere with security all over the country."

Security gains have been credited in part to a U.S. troop buildup last year as well as the decision by Sunni tribes and insurgents to turn against al-Qaida and back the United States.

The U.S.-funded Sunni movement faces a key test this week when the Shiite-led government begins to assume authority over the groups, also known as awakening councils.

In Mosul, a northern city that remains a security challenge for the Iraqi government and U.S.-backed forces, men in long white robes filled mosques as the city appeared quiet.

"People in mosques pray for peace on this sacred day," said Ahmed Abdul Rahman, 45-year-old photography shop owner. "The situation these days in Mosul does not allow for strolling in the streets in any area or traveling long distances."

Sunnis and Shiites both celebrate Eid, but often begin the festival on different days. In the past, that difference has sometimes underlined tensions between the two sects. This year, in an effort to minimize those tensions, the largely Shiite government of Prime Minister Nouri al-Maliki declared the days celebrated by both Sunnis and Shiite as national holidays.