Ahmadinejad's delegation includes Iranian Foreign Minister Manuchehr Mottaki, the head of Iran's Supreme National Council, Ali Larijani, and several cabinet ministers.
The visit is Ahmadinejad's first to Afghanistan since he became president in August 2005.
It comes amid U.S. and British charges that Iran is supplying arms to armed enemies of Afghanistan's central government.
Ahmadinejad dismissed those allegations during a press conference in Kabul and said a stable and secure Afghanistan is in Tehran's interests.
"We support the political process in Afghanistan with all our strength and power," Ahmadinejad said. "The security of Afghanistan has a [direct] impact on Iran because we [share] the longest borders and, for us, a secure and powerful Afghanistan is what is best."
At the same news conference, Karzai pledged to work to bring Washington and Tehran closer together.
"The governments of Iran and the United States have accepted that [what happens in] Afghanistan is in the interests of both countries, and they've been cooperating with the people of Afghanistan since the Bonn agreements," Karzai said. "Afghanistan would be happy to bring these two big nations close to each other, but that will depend on what the two sides would think about it.
Washington and London have warned against Iranian interference in Afghanistan.
U.S. President George W. Bush last week said he "would be very cautious about whether or not the Iranian influence there in Afghanistan is a positive force."
During a recent summit with Bush outside Washington, Karzai described Iran as "a helper and a solution" to problems in Afghanistan, pointing to Tehran's cooperation in the fight against terrorism and drugs.
Before he left Tehran, official Iranian news agency IRNA quoted Ahmadinejad as saying that "Iran and Afghanistan are two neighboring and brotherly countries that share common history, culture, and interests."
Iran and Afghanistan have expanded ties since the U.S.-led ouster of the Taliban in late 2001.
Relations between Iran and Afghanistan were strained earlier this year by Tehran's forcible repatration of tens of thousands of Afghan refugees.
Mohammad Akram Azimi the official in charge of Afghan refugees at the Afghan Embassy in Tehran, told Radio Farda on August 13 that the refugee issue would top the Afghan agenda for the talks in Kabul.
"The visit by Iranian President Mahmud Ahmadinejad to Kabul is, in our view, a breakthrough -- particularly because of the problems that Afghan refugees are facing in the Islamic Republic of Iran," Azimi said. "Therefore, one of the issues that will be discussed with Ahmadinejad in Kabul is the removal of the refugee problems -- and if there is a repatriation process, it should be done based on Afghanistan's capacity to accommodate the refugees."
Kabul is the Iranian leader's first stop on a trip that also includes notable visits to Central Asia. Ahmadinejad is scheduled to travel on to Turkmenistan and Kyrgyzstan, where he will attend a summit of the Shanghai Cooperation Organization (SCO), as an observer, on August 16.
Ahmadinejad is scheduled to travel to Turkmenistan to meet with that country's new president, Gurbanguly Berdymukhammedov.
Oguljamal Yazliyeva, the director of RFE/RL's Turkmen Service, said cooperation in oil and gas and the legal status of the Caspian Sea were likely to come up at the meeting in the Turkmen capital, Ashgabat.
"It is expected that the issue of the joint use of energy and the biological potential of the Caspian Sea, as well as the realization of a large-scale project of a transborder corridor -- north-south -- will be on the top of the agenda," Yazliyeva said. "Exporting energy resources and using multivector ways of exporting natural gas [are] very important for Turkmenistan, and Iran is the second [leading] country [to which] Turkmenistan exports its natural gas."
Iran will be participating as an observer at the SCO summit in the Kyrgyz capital, Bishkek.
Ahamadinejad was quoted earlier today as saying that he will use that gathering as the impetus for increased "regional commitments."
"We are going to attend the [Shanghai Cooperation Organization] summit, where we will have discussions with heads of state attending the summit to strengthen regional commitments," Ahmadinejad said.
Reports suggest that Tehran wants to enhance its role in the SCO and upgrade its status from "observer" to "member."
But Russian and Chinese officials have advised patience, saying recently that the SCO has no intention of accepting new members "at the moment."
(RFE/RL's Radio Free Afghanistan and Radio Farda, with additional material from agency reports)
Afghan President Hamid Karzai being greeted in Tehran in May 2006 (epa)
TEHRAN PLAYS ITS HAND. RFE/RL analyst Amin Tarzi led a discussion on the role Afghanistan may play in the delicate diplomatic game being played by Iran and the United States. Tarzi outlined ways in which Tehran might be flexing its muscle to show Washington that it can destabilize its neighbor.
LISTEN Listen to the entire briefing (about 70 minutes):
Real Audio Windows Media
RFE/RL's complete coverage of Afghanistan
UPDATED CONSTANTLY: Visit RFE/RL's Persian-language website, featuring news, analysis, features, streaming audio, and more, in Persian, from Radio Farda.