Sayyiduna Abdullah bin Mas'ud (may Allah be pleased with him) narrated: When it was the day of Badr and the captives were brought, the Messenger of Allah (peace and blessings be upon him) called Sayyiduna Abu Bakr (may Allah be pleased with him) and said: "What is your opinion about these people?" He said: O Messenger of Allah! They are your own people. If you kill them, they will enter the Fire, and if you take ransom for them, then whoever accepts Islam will be a support for us, and whoever refuses, we will take his ransom. He (peace and blessings be upon him) said: "O Umar! What is your opinion?" He said: My opinion is that you bring them forward and strike their necks, for these are the leaders of disbelief and the chiefs of disbelief. By Allah! They were not content with driving us out, until they became the first of the Arabs to wage war against us. Then the Messenger of Allah (peace and blessings be upon him) said: "O Abu Bakr! Your example is that of Ibrahim (peace be upon him) when he said: 'So whoever follows me is of me, and whoever disobeys me, then indeed You are Forgiving, Merciful' [Surah Ibrahim: 36]. And as for you, O Umar, your example is that of Nuh (peace be upon him) when he said: 'My Lord! Do not leave upon the earth a single inhabitant from among the disbelievers' [Surah Nuh: 26]."
Hadith Referenceالمعجم الكبير للطبراني / باب العين / 10219