Greek police say they have rescued 50 migrants who had been held hostage in northern Greece, allegedly by two Pakistani men who were extorting their families for money.

Police said Wednesday many of the rescued men were in bad physical condition, having been given minimal food and water. One man required hospitalization for pneumonia and dehydration.

The migrants — 38 Pakistanis, 10 Bangladeshis and two Sri Lankans — had been held in a complex of abandoned buildings east of the city of Thessaloniki, where most had been brought six days ago, although some were more recent arrivals. Authorities were alerted to their plight by relatives who received demands for money for them to be released.

Two Pakistani men were arrested on suspicion of kidnapping and blackmail, among other charges.