A rocket attack on a U.S. base near Iraq's border with Iran killed three American soldiers, an official said Thursday, blaming the strike on a Shiite militia linked to Tehran.

The deaths came at the end of the bloodiest month for U.S. troops in Iraq in two years, and with just six months before the American military is scheduled to leave after more than eight years of war.

Wednesday's rocket attack struck a U.S. base in southern Iraq that is located a few miles (kilometers) from the Iranian border, a U.S. military official said. He said the type of weapons used bore the hallmarks of a Shiite militia with strong links to Iran.

The official refused to give more details, and would not describe what kind of rockets were used against the base, or where it was. The official spoke on condition of anonymity because he was not authorized to release the information.

American intelligence officials have long believed that the Iranian-backed Kataib Hezbollah, or Hezbollah Brigades, is one of the only militias to use weapons known in military jargon as IRAMs, or improvised rocket-assisted mortars, against U.S. troops. The weapons are made in Iran.

Kataib Hezbollah, which has links to the Lebanon-based Hezbollah group, is solely focused on attacking U.S. troops and other American personnel.

The U.S. military is preparing to leave Iraq by the end of the year, as required by a 2008 security agreement between Baghdad and Washington.

But as both governments now consider extending the deadline to have thousands of troops remain in Iraq into 2012 -- in part to counter Iran's influence over the unstable nation -- at least three major Shiite militias have stepped up attacks on soldiers to force the military out.

Kataib Hezbollah claimed responsibility for a June 6 rocket attack on a U.S. base in Baghdad that killed five soldiers. In all, 15 U.S. troops have died this month in Iraq, all but one in hostile attacks. It's the highest number of military deaths in Iraq since June 2009.

Wednesday's deaths bring to 4,469 the number of American troops who have died in Iraq. That's according to an Associated Press count.