The deal had appeared to have fallen through earlier in the day when the 31-year-old Gilberto failed a medical but Tottenham's Web site later said it had been rescued.