ANBAR, Iraq -- Iran's supreme leader accused the United States on Sunday of trying to retake control of Iraq by exploiting sectarian rivalries, as Sunni insurgents drove toward Baghdad from new strongholds along the Syrian border.
Ayatollah Ali Khamenei's condemnation of U.S. action came three days after President Barack Obama offered to send 300 military advisers to help the Iraqi government. Ayatollah Khamenei may want to block any U.S. choice of a new prime minister after grumbling in Washington about Shiite premier Nouri al-Maliki.
The supreme leader did not mention the Iranian president's recent suggestion of cooperation with Shiite Tehran's old U.S. adversary in defense of their mutual ally in Baghdad.
On Sunday, militants overran a second frontier post on the Syrian border, extending two weeks of swift territorial gains as the Islamic State of Iraq and Syria pursues the goal of its own power base, a "caliphate" straddling both countries that has raised alarm across the Middle East and in the West.
"We are strongly opposed to U.S. and other intervention in Iraq," IRNA news agency quoted Ayatollah Khamenei as saying. "We don't approve of it as we believe the Iraqi government, nation and religious authorities are capable of ending the sedition."
Some Iraqi observers interpreted his remarks as a warning not to try to pick its own replacement for Mr. Maliki, whom many in the West and Iraq hold responsible for the crisis. In eight years in power, he has alienated many in the Sunni minority that dominated the country under ousted dictator Saddam Hussein.
Ayatollah Khamenei has not made clear how far Iran itself will back Mr. Maliki to hold on to his job once parliament reconvenes following an election in which Mr. Maliki's bloc won the most seats.
Speaking in Cairo, Secretary of State John Kerry said the United States wanted Iraqis to find a leadership that would represent all the country's communities -- though he echoed Mr. Obama in saying it would not pick or choose those leaders: "The United States would like the Iraqi people to find leadership that is prepared to represent all of the people of Iraq, that is prepared to be inclusive and share power," Mr. Kerry said.
The Iranian and the U.S. governments had seemed open to collaboration against ISIS, which also is fighting the Iranian-backed president of Syria, whom Washington wants to see removed.
"American authorities are trying to portray this as a sectarian war, but what is happening in Iraq is not a war between Shiites and Sunnis," said Ayatollah Khamenei, who has the last word in the Islamic Republic's Shiite clerical administration.
Accusing Washington of using Sunni Islamists and loyalists of Hussein's Baath party, he added: "The U.S. is seeking an Iraq under its hegemony and ruled by its stooges." During Iran's long war with Hussein in the 1980s, Iraq enjoyed quiet U.S. support.
Tehran and Washington have been shocked by the lightning offensive, spearheaded by ISIS but also involving Sunni tribes and Hussein loyalists. It has seen swathes of northern and western Iraq fall, including the major city of Mosul on June 10.
Iranian President Hassan Rouhani criticized oil-rich Sunni Gulf states that he said were funding "terrorists" -- a reference to the likes of Saudi Arabia and Qatar, which have backed Sunni rebels against Syria's Iranian-backed leader Bashar al-Assad.
"We emphatically tell those Islamic states and all others funding terrorists with their petrodollars that these terrorist savages you have set on other people's lives will come to haunt you," IRNA quoted Mr. Rouhani as saying on Sunday.
ISIS thrust east from a newly captured Iraqi-Syrian border post Sunday, taking three towns in Iraq's western Anbar province after seizing the frontier crossing near the town of Qaim on Saturday, witnesses and security sources said.
They seized a second, al-Waleed, Sunday.
The gains have helped ISIS secure supply lines to Syria, where it has exploited the chaos of the uprising against Assad to seize territory. It is considered the most powerful force among armed groups who seized Fallujah, just west of Baghdad, and took parts of Anbar's capital Ramadi at the start of the year.
The fall of Qaim represented another step toward the realization of ISIS's military goals, erasing a frontier drawn by colonial powers carving up the Ottoman empire a century ago.
ISIS's gains Sunday included the towns of Rawa and Ana along the Euphrates river east of Qaim, as well as the town of Rutba further south on the main highway from Jordan to Baghdad. Jordan said traffic had stopped arriving from Iraq.
An Iraqi military intelligence official said Iraqi troops had withdrawn from Rawa and Ana after ISIS militants attacked the settlements late Saturday. "Troops withdrew from Rawa, Ana and Rutba this morning and ISIS moved quickly to completely control these towns," the official said.
"They took Ana and Rawa this morning without a fight."
Relations between diverse Sunni fighting groups have not been entirely smooth. On Sunday morning, clashes raged for a third day between ISIS and Sunni tribes backed by the Naqshbandi Army, a group led by former army officers and Baathists, around Hawija, local security sources and tribal leaders said.
More than 10 people were killed in clashes in the area, southwest of Kirkuk, the sources said.