Sunan an-Nasa'i, Volume 3, Book 21, Hadith 1953 (DarusSalam)

It was narrated that Ibn 'Abbas said: "The Messenger of Allah was asked about the children of the idolators and he said: 'Allah created them when He created them, and He knows best what they would have done."'

أَخْبَرَنَا مُحَمَّدُ بْنُ الْمُثَنَّى، قَالَ حَدَّثَنَا عَبْدُ الرَّحْمَنِ، قَالَ حَدَّثَنَا شُعْبَةُ، عَنْ أَبِي بِشْرٍ، عَنْ سَعِيدِ بْنِ جُبَيْرٍ، عَنِ ابْنِ عَبَّاسٍ، قَالَ سُئِلَ رَسُولُ اللَّهِ صلى الله عليه وسلم عَنْ أَوْلاَدِ الْمُشْرِكِينَ فَقَالَ ‏ "‏ خَلَقَهُمُ اللَّهُ حِينَ خَلَقَهُمْ وَهُوَ يَعْلَمُ بِمَا كَانُوا عَامِلِينَ ‏" ‏ ‏.‏

sunnah.com