The Sunday meeting started in the morning and carried on until the evening, with the two politicians holding a news conference afterwards in which they announced they had agreed to form a broad-based national unity government.
The visit of al-Jaafari, who leads the Shia al-Dawa party, to predominantly Kurdish northern Iraq came after the visit of Abd al-Aziz al-Hakim, chairman of the Iran-backed Supreme Council for Islamic Revolution in Iraq (SCIRI), the dominant Shia party in Iraq.
Kurdish parties had shown dissatisfaction with al-Jaafari's performance and accused him of neglecting his partners in the political process. Sunday's visit was the first by the prime minister since he was elected in mid-2004.
The race to meet and discuss the political situation in Iraq after December's parliamentary elections included the Iraqi Sunni Arab political parties.
A delegation from the main Sunni coalition, the Arab National Accordance Front, also met senior Kurdish officials on Sunday, possibly holding preliminary discussions about the formation of a coalition government ahead of final election results due to be released this week.
It was the first trip by a Sunni Arab delegation to Iraq's Kurdish region after the 15 December parliamentary elections, whose results have been contested by the sectarian minority and secular parties.
Al-Ani said his group wants an end
to post-election differences
The 10-member delegation was led by two of the front's three leaders: Adnan al-Dulaimi, leader of the General Conference of the Iraqi People, and Tariq al-Hashimi, head of the Iraqi Islamic party.
A representative of the secular party led by Iyad Allawi, a Shia and the former prime minister, said the group had not been invited to the Kurdish north, which in recent days has seen a flurry of post-election bargaining between the Kurds and the governing Shia United Iraqi Alliance, which has a strong election lead.
Dhafir al-Ani, spokesman for the Accordance Front, told Aljazeera.net the visit had objectives different from those of the visits by al-Jaafari and al-Hakim.
"Mr al-Jaafari and Mr al-Hakim may have talked about the formation of the new government in light of the results of last December's elections, but we have a different point of view," he said.
"We sought the meeting with Mr Barzani to try to find an exit to solve the differences triggered by the election results," he told Aljazeera.net.
Sunni Arab and secular Shia groups have complained that widespread fraud and intimidation tainted the elections and have demanded a rerun of the poll in some provinces including Baghdad, the country's largest with 59 of parliament's 275 seats.
They have also welcomed an international electoral monitoring team that is to arrive in Baghdad on Monday to assess the election process, a key opposition demand.