(RFE/RL) -- Iranian President Mahmud Ahmadinejad has used a visit to Afghanistan to lambast Kabul's Western allies, particularly the United States, saying Washington -- not Tehran -- was playing a "double game" in the country.
Ahmadinejad accused the United States of fighting terrorists that it helped to create.
The remarks in Kabul come one day after U.S. Defense Secretary Robert Gates, also speaking on a visit to Afghanistan, leveled a similar accusation against Iran.
Gates said Tehran was trying to have a good relationship with the Afghan government while undermining U.S. and NATO efforts by providing some support to the Taliban.
But Ahmadinejad used the opportunity of his visit to lambast Afghanistan's Western allies, saying that he did not consider their military presence "a solution for peace" in the country.
"[The Western countries] are against security and development in our countries, and they are ready to spend hundreds of billions [of dollars] to defeat our nations because they think they will gain much more from such efforts," Ahmadinejad said. "But I am sure that they will be defeated by the resistance of these nations, particularly Afghanistan."
Little is known about the behind-the-scenes discussions between Afghan President Hamid Karzai and his visiting Iranian counterpart.
But the timing of Ahmadinejad's visit, which came as Gates left Afghanistan after a three-day tour, and what he said at a joint press conference with Karzai instantly stirred controversy.
Ahmadinejad also accused the West of supporting ethnic Baluchi Sunni separatists organized in a shadowy militant organization called Jundallah.
He praised the arrest of its leader Abdolmalik Rigi last month and praised the intelligence operation to nab him as an example of the right way to fight terrorism.
Karzai praised Tehran for spending hundreds of millions of dollars in rebuilding roads, providing electricity, education and health care in parts of Afghanistan.
"I want to thank you for the help and assistance that the Iranian people provided during the past seven years," Karzai said. "Iran has been a true friend and partner of the Afghan nation. During the years of jihad [against the Soviets] and resistance [against the Taliban], Iran was a supporter of the Afghan nation. It hosted a million [Afghan] refugees and provided them with education opportunities."
While Iran's assistance is has been broadly welcomed in Afghanistan, observers in Kabul are suspicious of its investments in Afghan media and support for Afghan Shi'ite communities, in particular the Hazaras.
Once neglected and oppressed, the 3 million-strong Hazaras now enjoy a major share in the Afghan government and are also making significant progress in education and private sectors -- partly because of generous assistance from Iran's clerical regime.
Western officials have also accused Tehran of supporting the Taliban and other insurgent groups.
Such complications have forced Karzai to look for ways to establish friendly relations with his neighbors particularly Pakistan and Iran while trying to preventing them from using Afghanistan as their proxy battleground.
Standing besides Ahmadinejad, the Afghan leader used more diplomatic language while urging greater cooperation from Tehran.
"I hope, my dear brother, that the great Iranian nation will help and cooperate in bringing lasting peace to the brotherly nation of Afghanistan," Karzai said. "So that, with your help, the grieved nation of Afghanistan finally can enjoy a normal life and peace."
Karzai was to head to Pakistan later today on a two-day visit. The cooperation of both Iran and Pakistan is seen as crucial for efforts to find a political solution with the Taliban to end the conflict in Afghanistan.
with agency reports