Ten U.S. Marines died Thursday when a makeshift bomb blasted their foot patrol outside the western city of Fallujah, the military reported Friday. It was the deadliest attack on U.S. forces in almost four months.

Eleven other Marines were wounded by the explosion, which came from a device made up of several large artillery shells, the military said. Seven of the injured Marines returned to duty.

An attack occurred about 10:30 p.m. Thursday near the gate of a cement factory east of downtown Fallujah, according to Abdul Karim Salah, who was working the night shift at the plant. He described what appeared to be a car bomb exploding near a convoy of U.S. military vehicles, damaging two of them. After the blast, a pair of helicopters evacuated the dead and wounded, he said. It was not clear if this was the same incident reported by the military.

A little more than a year ago, thousands of U.S. and Iraqi troops leveled much of Fallujah -- which had become Iraq's main insurgent stronghold -- in the largest offensive since the 2003 invasion. During two weeks of fighting, they established a strict cordon around the city, 35 miles west of Baghdad, establishing four heavily guarded entry points equipped with metal detectors and bomb-sniffing dogs.

Following the assault, according to local politicians and military commanders, Fallujah had gradually become one of the safest and most stable cities in Anbar province, which spans the vast desert west of Baghdad to the Syrian border and is considered the heartland of the country's Sunni Arab-led insurgency. In August, 14 Marines were killed by a roadside bomb that tore apart their armored personnel carrier in the Anbar city of Haditha, but Fallujah has experienced little heavy fighting and few large-scale attacks in recent months.

The city's police force, disbanded before the offensive last year, has returned to duty and numbers about 1,200, local officials said. A pair of Iraqi army battalions now patrol much of the northern half of the city, together with a single battalion of U.S. Marines. And while turnout in Anbar for Iraq's October constitutional referendum was only about 40 percent, it topped 90 percent in Fallujah, a city of about 250,000.

"One year ago, major combat operations in Fallujah. And in the referendum, 200,000 folks voted in Fallujah," the main U.S. military spokesman in Iraq, Maj. Gen. Rick Lynch said at a news conference this week. "Great improvement."

On a visit to the city this week, the provincial governor, Mamoun Sami Rashid, spent the first half of a 10-minute speech praising the city's progress. "The first thing that came to my mind when I entered Fallujah is the stability," said Rashid, who rarely leaves the violence-plagued provincial capital, Ramadi, and has survived at least seven assassination attempts since taking office on June 1. "What you had before the invasion is what we have in Ramadi now."

But insurgents retained a strong presence and continue to operate in Fallujah, according to soldiers and Iraqi politicians and civilians interviewed there this week.

"We knew al Qaeda wouldn't leave the city, and it happened. They came back," said Khalid Muhsin, a preacher in a local mosque. "Now they attack in different ways. They kidnap and assassinate people. People in the city are tired of the fighting and want to rest."

On Tuesday, gunmen in a silver BMW shot dead Hamza Abbas Asawi, the city's mufti, or top religious cleric, as he was leaving an evening prayer service. Asawi was considered an ally by U.S. forces. A day later, two Marines were killed by small arms fire, the military reported.

The last lethal car bombing in Fallujah was in early summer, but roadside bombs and sniper fire are constant threats, said Lt. Patrick Keane, of Aberdeen, N.J. Keane is a member of the 8th Marine Regiment, which patrols the city.

"It's a whole lot quieter now than it was, even back in March," Keane said Tuesday during a visit to the city by U.S. diplomatic officials, Iraqi election workers and journalists to discuss plans for the Dec. 15 parliamentary elections. "But you can't say it's safe here."

Asked how many insurgents there were in Fallujah, a U.S. official said, "It's hard to say, but there's sympathy for the insurgency. Basically everyone here has the potential to be an insurgent."

Residents still complain that heavily guarded checkpoints are dangerous and stifle economic activity and that U.S. soldiers on patrol are too willing to shoot first when encountering residents.

"It seems we lose someone every week who is killed by the Americans for wrong reasons," said Fawzi Muhammed, the deputy chairman of the city's reconstruction committee, who said his cousin was shot dead by U.S. soldiers this year while standing in front of his home.

"Many things are not good," he added, "but I think compared to all of the cities in Anbar, Fallujah is the safest and the best."

After the offensive last year, much of the city lay in ruins.

"It was like an earthquake," said Farouk Abd-Muhammed, a local engineer who is running for a national assembly seat on Dec. 15. "After Hiroshima and Nagasaki, there was Fallujah."

The Iraqi government authorized $105 million to rebuild houses damaged in the fighting. Nearly all of that money has now been dispersed, an amount representing about 40 percent of the assessed value of the damaged properties, the State Department representative said.

A drive this week along the city's main thoroughfares showed some new buildings and others that were still bombed-out shells or pocked with bullet holes.

In Washington on Friday, Sen. John W. Warner (R-Va.), chairman of the Armed Services Committee, said he believed the Marines killed and injured in Fallujah on Thursday were in a location they thought was "perfectly safe" when they were hit.

"The magnitude of the ordnance is awesome. Probably four very large shells were linked together and exploded," Warner said at a Capitol Hill news conference.

Warner said the issue of improvised explosive devices, the military's term for roadside bombs, was of paramount importance to U.S. leaders because insurgents have been able to use them so effectively. Many of the bombs include large, unexploded artillery shells, which when wired together produce enormous blasts.

"There's no question before the Pentagon today, or the American public, of greater seriousness than the lethality of this particular type of weaponry," Warner said.

Elsewhere in Iraq on Friday, U.S. and Iraqi troops continued to wage separate offensives in Ramadi and in Hit, another Anbar city. They are the latest in a string of counterinsurgency operations conducted in the province, which commanders have described as a haven for foreign fighters entering Iraq from Syria.

No coalition casualties were reported in either operation. The military also announced Friday that three soldiers had died in a vehicle accident north of Baghdad and a Marine in Ramadi was killed Thursday when the vehicle he was riding in was struck by a rocket.

Staff writer Josh White in Washington contributed to this report.

Marine Lance Cpl. Jose Murillo consults a pocket Arabic language guide while an Iraqi soldier talks to a family in Sadah, a town near Iraq's border with Syria.