Pakistanis kiss their homeland as they cross at Wagah
Joyous relatives have greeted released prisoners at the India-Pakistan border in the biggest exchange since a new peace process began last year.
Throughout the day hundreds of inmates, mostly farmers and fishermen who had crossed borders illegally, have been exchanged at the Wagah crossing point.
They had served their sentences but diplomatic pressure kept them detained.
The exchange came two days before the country's leaders meet on the sidelines of a UN forum in New York.
Relatives on the Pakistani side banged drums while returning Indian prisoners were garlanded and given traditional sweets.
Hussain, an Indian fisherman, was typical of many in saying he simply strayed into Pakistani waters.
"We were arrested and were in prison for the past two years," he told Reuters.
"I have come back, but don't know what fate awaits me. Our family is very poor and I don't know how they fared without me."
Pakistani prisoner, Mohammed Ashfaq, said he was tortured during a two-year detention in Jammu, Indian-administered Kashmir.
"I crossed the border accidentally on my bicycle and was captured in 2003. I am so happy to be back home," he said.
The BBC's Asit Jolly at Wagah says amid the festive atmosphere there was also despair for scores of families who still have no word about their loved ones.
These include the family members of 54 Indian PoWs who, according to their relatives, are still being held captive in Pakistan.
Even as this exchange took place, another 24 Indian fishermen were detained on Sunday for illegally entering Pakistani territorial waters.
Most of the prisoners were farmers and fishermen
It had earlier been announced that 435 Indian and 152 Pakistani prisoners were expected to return home.
Border officials at Wagah extended opening time by several hours to try to process them.
In the past decades hundreds of people have been arrested on the wrong side of the border, most saying they had strayed because it was so poorly marked.
The exchange comes ahead of a meeting on Wednesday of Indian Prime Minister Manmohan Singh and Pakistani President Pervez Musharraf on the sidelines of the UN General Assembly in New York.
Speaking of the prisoners on Friday, President Musharraf said: "They are poor people. What are we doing spoiling their lives?"
A number of measures have been taken to improve bilateral relations since the peace process began early last year.
However, movement still needs to be made on the key issue of Kashmir, which both nations claim in its entirety and over which the nations have fought two wars since independence in 1947.