Police said the parents had taken their son to the Hilal-i-Ahmer hospital in Latifabad, about 160 kilometres (100 miles) northeast of Karachi, where he was kept for 36 hours.
The couple took the baby home, where several hours later they discovered that it was not their son, but an unidentified baby girl.
"We are investigating the matter and hope to resolve it soon," local police official Naik Mohammad Khosa told AFP.
Sons are prized in conservative Pakistani families, and baby boys have been stolen in the past from the maternity sections of public hospitals.