A man with a knife in hand climbed the stage minutes after Congress leader Harish Rawat had finished his speech at a rally in Kashipur in Udham Singh Nagar district recently and began shouting "Jai Shree Ram".
However, Youth Congress workers soon overpowered him and handed him over to the police.
The man was mentally unstable, Kashipur Additional Superintendent of Police Chandra Mohan Singh said.
He had climbed onto a tower in the town a few days earlier insisting on talking to the prime minister, Singh said.
The incident occurred on Thursday evening soon after Rawat had got down from the stage after finishing his speech.
A case under the Arms Act has been registered against the man who is in his 40s, the police officer said.
When contacted, Rawat said he had also heard the noise on stage after he had finished his speech at the Kashipur rally but ignored it as he had other events to attend.