The construction workers, employed by a Kuwaiti company, were kidnapped by an unidentified group in southern Iraq while travelling from the southern Iraqi city of Basra to the capital Baghdad on August 13.
They are due to return to Kuwait shortly, said Pakistani foreign ministry spokesman Mohammed Naeem Khan.
Mr Khan reiterated Islamabad’s advice to Pakistanis not to travel to Iraq, where he said the security situation was “precarious”.
Iraq has been rocked by a wave of abductions of foreigners since April 2004.
Egypt’s envoy to Iraq, Ihab al-Sharif, was kidnapped on July 2 by gunmen as he stopped his car on a Baghdad street and was killed a few days later.
A statement purportedly posted on the Internet by the group of Al-Qaeda’s Iraq frontman, Abu Musab al-Zarqawi, claimed responsibility.
Three days earlier, Pakistan’s ambassador to Iraq narrowly survived a militant attack on his convoy.
Islamabad closed its mission in Baghdad and envoy Younis Khan was evacuated to the Jordanian capital Amman.
In April an employee at the Pakistani embassy in Baghdad was abducted as he went to a mosque for evening prayers in April. He was released two weeks later.
In July 2004, two migrant workers from Pakistani Kashmir were killed in Iraq after their captors alleged they were spying for the United States and that Pakistan was planning to deploy troops in Iraq.
Another kidnapped Pakistani was released the same month after eight days in captivity.
The abductions and attacks on Pakistanis have come despite Islamabad’s opposition to the US-led invasion of Iraq in March 2003.
President Pervez Musharraf, a key US ally in the “war on terror”, has refused requests from both the United States and the Iraqi leadership to send peacekeeping troops.
Indian nationals have also been caught up in the Iraq violence. In August 2004 three Indian truck drivers working for a Kuwaiti oil company were kidnapped and later released, resulting in an Indian government ban on all travel to Iraq.