Sean Gilpin, 21, an exercise rider and a Jamaican immigrant, said he had a green card, but that he knew backstretch workers without legal status. They work for trainers who will pay them in cash at a lower rate because they are unauthorized, he said, and often confine themselves to the backstretch and send co-workers for food and other errands outside the track.

Leonard D’Arrigo, a lawyer in Albany who helps trainers obtain seasonal visas for immigrant workers, said immigration officials had reviewed trainers’ employment records at Saratoga looking for undocumented backstretch workers. He said his recent interactions with immigration officials left him with the impression that a raid of the backstretch was possible.

“The track is a prime target because ICE knows they have, all in one place, hundreds of people who may be undocumented,” he said

A spokesman for ICE, Khaalid Walls, said the arrests here in May and June were “targeted enforcement” that were made on the street and were the result of an “ongoing investigation.” Nine of the 27 people detained were charged with having re-entered the country illegally after having been deported, he said, which is a felony.

Mr. Walls would not comment on whether the agency had any enforcement plans involving the racetrack.

A spokesman for the New York Racing Association, which runs the Aqueduct, Belmont and Saratoga racetracks, Patrick McKenna, said the number of workers residing on the backstretch this season was about 1,100, about the same as in previous years, and that he knew of no immigration enforcement actions at the track this season.

The association does not employ the backstretch workers, Mr. McKenna said, so it is up to the trainers to verify their immigration status.