Afghan President Hamid Karzai reached the deal with Iranian President Hassan Rouhani in Tehran on Sunday. The joint communique issued after the talks stipulates that foreign ministers of both counties were assigned to draw up the topics of such a pact, IRNA reports

At the meeting Rouhani voiced Iran’s strong opposition to foreign presence and its destabilizing effect for the region.

“We are concerned about tension arising out of the presence of foreign forces in the region, believing that all foreign forces should get out of the region and the task of guaranteeing Afghan security should be entrusted to the country’s people,” Rouhani was cited by IRNA as saying.

For his part Karzai said that the Afghan government is keen on signing the pact with the Islamic Republic. The Afghan president also congratulated his counterpart on securing a nuclear agreement in Geneva that defused decades-long tensions.

This is while US defense secretary Chuck Hagel said earlier that he supports a NATO force in Afghanistan after 2014, as Washington and Kabul continue negotiations on securing a Bilateral Security Agreement (BSA) that will allow foreign forces to stay in the country past the deadline.

“I believe there is a role for our coalition partners and the United States, but that depends on the Afghan people,” Hagel told US troops in Afghanistan on Sunday. “If the people of Afghanistan want to continue that relationship, then we will.”

Hagel did not meet Karzai during his trip to US bases in Afghanistan this weekend, but he is optimistic that the new pact between US and Afghanistan will be signed. “I have hope that the BSA will get signed,” he said on a stop in Kandahar as he acknowledged “uncertainty about what happens next.”

Last week, Karzai said that he may not sign the US-Afghan security pact until April, despite approval from the Loya Jirga, an assembly of Afghan elders. On Saturday Hagel warned against the delay, saying there was “a cut-off point” at which time the pact would be scrapped, but adding he was “not prepared to give a date on that.”