Surah Ghafir — Ayah 83 (40:83)
فَلَمَّا جَآءَتۡهُمۡ رُسُلُهُم بِٱلۡبَيِّنَٰتِ فَرِحُواْ بِمَا عِندَهُم مِّنَ ٱلۡعِلۡمِ وَحَاقَ بِهِم مَّا كَانُواْ بِهِۦ يَسۡتَهۡزِءُونَ ٨٣
English translation (Saheeh International)
And when their messengers came to them with clear proofs, they [merely] rejoiced in what they had of knowledge, but they were enveloped by what they used to ridicule.
Brief commentary
When their messengers brought clear proofs and great miracles to them, they denied them and were happy with the knowledge they had that contradicted whatever their messengers came with. So the very punishment they would mock when warned of by their messengers, came upon them.