Afghanistan and Pakistan have a "new relationship" and determination to defeat terrorism and extremism, President Hamid Karzai said Tuesday after talks with his counterpart Asif Ali Zardari.

Islamabad and Kabul have been unable to rein in the extremists that have been holed up in Pakistan''s lawless tribal areas since they fled Afghanistan after the US-led invasion that drove out the Taliban government in late 2001.

The situation has strained relations between the two Islamic nations, with Karzai accusing Pakistan of not doing enough to shut down militant "sanctuaries" on its soil and stop insurgents from crossing into Afghanistan.

But Karzai said Tuesday after talks with Zardari, who was making his first official visit to Afghanistan since taking office in September last year, that a new era had begun.

"Afghanistan and Pakistan have a new relationship," Karzai told a joint press conference.

"We hope that this friendship, this new relationship achieves what is desired by both nations, which means a strong fight against terrorism, terrorism is defeated and is forced out, extremism is defeated," he said.

Zardari added: "We intend to work towards a better tomorrow."

"We want to tell the world today, together, standing shoulder to shoulder, that we are together in this fight against these non-state actors who have taken nations, countries and in fact superpowers to war," he told reporters.