"Ho gaya, aage nahin hoga. Humein pata chala ki aisa bhi ho sakta hain (It has happened, it will not happen again. We have learnt that even this could happen), Mr Singh, who is a parliamentarian from Uttar Pradesh, said at the News18 Rising India Summit in New Delhi.
In the Lok Sabha by-elections held for the Gorakhpur and Phulpur seats, the BJP lost to the Samajwadi Party that had an electoral understanding with its bitter rival, the Bahujan Samajwadi Party.
Gorakhpur was considered a BJP bastion, a seat Yogi Adityanath won five successive times till he was made Uttar Pradesh chief minister last year. The Phulpur seat that the BJP had won for the first time in 2014 was vacated by Keshav Prasad Maurya who was made Yogi Adityanath's deputy.
Yogi Adityanath, who had extensively campaigned for the bypolls, had said the results were a "lesson". He had cited overconfidence and inability to understand the SP-BSP tie-up among the reasons for the BJP's defeat.
Responding to Congress president Rahul Gandhi's remarks that the "country was rising against the BJP", the home minister said "He is our opposition leader and will keep saying things. But only time will tell against whom the country is rising".
Asked if he had prime ministerial ambitions, Mr Singh said he was not overambitious.
"I am not overambitious. But if anyone is given the opportunity, they must fulfil it. Our Prime Minister is doing a very commendable job," he said, reported news agency PTI.