Making terrorism the centrepoint of his over 20-minute speech, he said terror was the worst enemy of humanity and called upon the world community to speak in one voice against the menace to put an end to it.
"Terrorism does not have any boundaries. It is bound to destroy all...A need has arisen to root out those who spread terrorism. Those who help terrorists and provide shelter to them can no longer be spared," he said in an obvious reference to Pakistan without taking its name.
"The forces of humanism should unite globally to end the menace," he said.
Modi became the first Prime Minister to attend a Ramlila event outside Delhi and his participation at the Aishbagh celebrations assumes significance in the context of assembly elections in Uttar Pradesh early next year.
Also Read
Modi said only BJP could fulfil aspirations of the people
of Uttar Pradesh and appealed to the electorate in Awadh region to vote for the party in the coming Assembly polls in the state.
"For Uttar Pradesh to progress, poverty and goonda raj need to be removed," he said.
Asking people to learn to use mobile banking, Modi said, "I am addressing you through mobile. You can turn your mobile into your bank. You have to learn it slowly."
Modi was national general secretary of BJP when he visited Bahraich in 2001 for the first time, and later in November 2013 for the second time.
This was BJP's 5th Parivartan Yatra to be addressed by the Prime Minister in the state.
State BJP President Keshav Prasad Maurya said, "The Prime Minister Narendra will try to come again to Bahraich when his schedule and weather allow.