A car bomb exploded in a crowded outdoor market in the northern city of Kirkuk on Tuesday, killing at least 27 people, police said, a deadly reminder of the challenges facing the Iraqi government even as it celebrated the withdrawal of U.S. combat troops from cities.

The bombing marred what had otherwise been a festive day as Iraqis commemorated the newly declared National Sovereignty Day with military parades and marching bands. It also came hours after four U.S. soldiers were killed in combat Monday in Baghdad. Although there were no immediate claims of responsibility, the bombing and the way it was carried out bore the hallmarks of al-Qaida in Iraq.

Despite the violence, Prime Minister Nouri al-Maliki assured Iraqis that government forces taking control of urban areas were more than capable of ensuring security.

"Those who think that Iraqis are not able to protect their country and that the withdrawal of foreign forces will create a security vacuum are committing a big mistake," he said in a nationally televised address.

He later appeared at a military parade to mark the day in the walled-off Green Zone in central Baghdad, with soldiers and policemen marching in formation while Iraqi helicopters flew overhead.

The withdrawal, which was completed on Monday, was part of a U.S.-Iraqi security pact and marks the first major step toward withdrawing all American forces from the country by Dec. 31, 2011. President Barack Obama has said all combat troops will be gone by the end of August 2010.

The car bomb exploded as the vegetable and poultry market was crowded with people shopping for their evening meal, police Brig. Gen. Sarhat Qadir said. Police and hospital officials gave the death toll and said about 40 people were wounded.

One eyewitness, 53-year-old Samad Hajir, was buying chicken at the market when he heard the explosion followed by screams.

He blamed the Iraqi security forces for not being at the market and said he feared that militants would try to take advantage of the withdrawal.

"I am worried about the handing over of security to the Iraqi forces. I think that the insurgents will come up soon after the withdrawal of U.S. soldiers from our cities. It seems that all the Kirkuk police were busy celebrating the withdrawal," Hajir said.

It was the latest in a series of bombings and shootings that have killed more than 250 people since June 20, including a truck bombing near Kirkuk that killed 82 people.

U.S. and Iraqi officials have warned more violence was likely as suspected Sunni insurgents try to undermine confidence in the government in the days surrounding the withdrawal deadline.

The top U.S. military commander in Iraq said that despite an increase in "spectacular bombings," violence had dropped to 2003 levels.

"The attacks show al-Qaida will now go after the softest of soft spots just to kill innocent civilians in order for them to try and ignite sectarian violence," Odierno said.

The military said the four U.S. soldiers who were killed Monday served with the Multi-National Division-Baghdad but did not provide further details pending notification of their families. It said they died as a "result of combat related injuries."

It was the deadliest attack against U.S. forces since May 21, when three soldiers were killed and nine others were wounded in a roadside bombing in southern Baghdad.

Odierno said the latest deaths show militants remain a threat but said he was confident Iraqi security forces could face the challenge.

"It reminds me that there are still dangers out there. There are still people out there who do not want the government of Iraq to succeed. They do not want to see a democratic country move forward," Gen. Ray Odierno said Tuesday at a news conference.

He said many roadside bomb and rocket attacks in Baghdad were being carried out by militants being funded or trained by Iran, including recent strikes against the Green Zone, which houses the U.S. Embassy.

But, he said, the number of such attacks was "significantly smaller" due to security measures making them more difficult to carry out.

"Iran is still supporting, funding and training surrogates who operate inside of Iraq. They have not stopped and I don't think they will stop," Odierno told reporters at Camp Victory, a U.S. military base on the western edge of Baghdad.

He also said that 130,000 U.S. troops remain in Iraq, although he declined to say how many would remain in cities as trainers and advisers.

"We will be here, we are not leaving," he said. "We'll continue to be in support of the Iraqi security forces to maintain and improve stability throughout the country and I feel confident that we'll be able to do that."

If the Iraqis can hold down violence in the coming months, it will show the country is finally on the road to stability. If they fail, it will pose a challenge to Obama's pledge to end an unpopular war that has claimed the lives of more than 4,300 U.S. troops and tens of thousands of Iraqis.

Some U.S. troops will remain in the cities to train and advise Iraqi forces. U.S. combat troops will return to the cities only if asked. The U.S. military will continue combat operations in rural areas and near the border, but only with the Iraqi government's permission.