The youth, whose identity was not immediately available, was held by the police who seized a pistol from his waist.
The youth, who appeared to be in his twenties, was present among a crowd of people close to Gandhi who was taken to Kasna police station after being arrested at Bhatta Parasul, the epicentre of farmers' agitation against land acquisition by Uttar Pradesh government. Gandhi had gone to Bhatta Parasul to express solidarity with the farmers.
The youth was later handed to the special protection group personnel guarding Gandhi and questioned.
Rahul Gandhi released on bail in UP; reaches Delhi
Farmers' stir: Fight democratically, says Rajnath
Farmers' stir: Tension simmers in western UP, BJP calls for bandh
UP farmers' fury spreads, toll rises to 4
Compensation not the cause of Noida stir: UP govt