وَكَذَٰلِكَ أَخْذُ رَبِّكَ إِذَآ أَخَذَ ٱلْقُرَىٰ وَهِىَ ظَـٰلِمَةٌ ۚ إِنَّ أَخْذَهُۥٓ أَلِيمٌ شَدِيدٌ
Wa kazaalika akhzu Rabbika izaaa akhazal quraa wa hiya zaalimah; inna akhzahooo aleemun shadeed
Such is the punishment of your Lord for towns in the midst of their sins: His punishment is terrible and severe.
Such is the seizure of your Lord when he seizes the towns while they are doing wrong. Indeed, his seizure is painful, severe.
Kadhālika points back across the whole surah, where the ruin of Nuh's people, 'Ad, Thamud, Lut's town and Madyan has been narrated one after another, and here the series is named as a single pattern. The condition attached carries the weight: a town is seized while its wrongdoing is still under way, so the moment is set by conduct.