Investigators believe the men were recruited by the terror group Indian Mujahideen for an attack ahead of the polls. They were allegedly planning to target an "unarmed gathering of people or security forces."
Sources say they were in possession of ammunition enough to kill 100 people. Weapons recovered include two AK 47s and four pistols.
The arrests have exacerbated security fears in the middle of a charged campaign in the sprawling state, where polling for 80 parliamentary seats will be held over six days from April 10. Gorakhpur is around 200 km from Varanasi, the high-profile constituency from where BJP's prime ministerial candidate Narendra Modi is contesting the election. However, sources say, Varanasi and Mr Modi were not on the terrorists' target.
The two suspects, identified as Murtaza and Owais, were arrested on Wednesday evening by the Uttar Pradesh anti-terror squad. Sources say they came to Gorakhpur 15 days ago from the porous border with Nepal, the route usually taken by suspects from Pakistan.
The police reportedly received information about the suspects from the interrogation of Indian Mujahideen chief Tehseen Akhtar, who was arrested from Darjeeling near the Nepal border on Tuesday. (read: Alleged terrorist claims Fidayeens in UP)
Sources say their link to the Indian Mujahideen was confirmed after they recognized a photograph of the group's co-founder Riyaz Bhatkal, who is believed to be in Pakistan. They reportedly said they knew him as "Tauseef."
This is the third terror arrest after investigators caught Tehseen, a 23-year-old bomb-maker who had headed the Indian Mujahideen since the arrest of its co-founder Yasin Bhatkal in August. (read: IM boss Tehseen Akhtar arrested)
Tehseen, also known as Monu, had not just planned several terror attacks, including the blasts targeting Narendra Modi's rally in Patna in October, but also helped set up an arms factory in the capital.
Before him, the police had arrested another suspected Indian Mujahideen operative, Zia-ur-Rehman or Waqas, in Ajmer, Rajasthan.