General Lloyd Austin said violent activity by externally supported insurgent groups was threatening security in Iraq as it emerges from the shadow of decades of war and economic sanctions and tries to rebuild.
"Security improvements over the past few years in the south that have encouraged economic development are being threatened by externally supported illegal militias and other extremists," Austin said during a ceremony to mark America's independence and the opening of a U.S. Consulate General in Basra.
"These violent criminal elements if left unchecked will create an environment that forces foreign investors to pull out of the country. ... Violence and economic prosperity cannot co-exist."
Iraq needs investment in almost every sector and although violence has eased from the height of sectarian fighting in 2006 and 2007, daily attacks and killings more than eight years after the U.S.-led invasion still rattle some foreign investors.
At least 28 people were killed and dozens more wounded on Tuesday when twin bombs exploded in a crowded parking lot outside a government building north of Baghdad, a day after a series of attacks on Iraqi police and soldiers.
June marked the deadliest month for civilians since January, with 155 killed. Fourteen U.S. service members were also killed last month, the highest toll since June 2008.
Attacks against Iraqi and U.S. security forces appear to be mounting in a bid to undermine Iraq's capability to secure itself as its leaders discuss the divisive issue of whether to ask the United States to leave some troops beyond December.
The southern port city of Basra is a hub for foreign investment, particularly in its vast strategic oilfields, and protecting oil infrastructure is vital as the government tries to increase production and exports.
While the southern oilfields have been relatively peaceful in recent years, two bomb attacks this year have raised concern.
Iraq cracked down recently on Shi'ite militias to try to stem the supply of illegal weapons into its mainly Shi'ite southern areas from Shi'ite neighbor Iran.
"They (weapons) are coming in from Iran. We're certain of that and we're fairly certain of the types of weapons being employed," Austin said, declining to give further details.
"The types of people who are doing this are obviously focused on discrediting the government and trying to prove that the government can't function."
U.S. Ambassador to Iraq James Jeffrey said violence had a particular impact on U.S. firms.
"What we haven't seen yet ... is a lot of American investment (in Iraq)," Jeffrey told Reuters in an interview.
"It (violence) has a certain, particular impact on American investments because because of the specific targeting of American entities and firms and kidnappings."