Seed dispersal and predation by spiny rats (Proechimys semispinosus) and red-tailed squirrels (Sciurus granatensis) were studied in five forest gaps and adjacent forest understorey on Barro Colorado Island, Panama, during June and July 2003 and January 2004. Live trapping on grids was used to estimate the abundances of rats in both habitats and was conducted during 10 nights at the beginning of each field season. We captured 70 individual spiny rats (53 in forest gaps and 17 in understorey). To address the removal and dispersal of seeds, semi-permeable wire-mesh exclosures were set at randomly selected stations within the trapping grids. These exclosures allowed the entry of spiny rats, squirrels, and other small rodents but excluded larger granivorous mammals. Seeds were marked with pieces of string that were dusted with fluorescent powder and tracked at night with an ultraviolet light. A total of 304 seeds was removed (159 in forest gaps and 145 in understorey). Spiny rats removed more seeds from gaps, and squirrels removed more seeds from understorey. Both species dispersed more seeds during the rainy season than during the dry season. Squirrels dispersed seeds farther than did spiny rats. Due to their foraging behaviour and association with gaps, spiny rats may disperse seeds from forest understorey into gaps.