فَكَذَّبُوهُ فَعَقَرُوهَا فَدَمْدَمَ عَلَيْهِمْ رَبُّهُم بِذَنۢبِهِمْ فَسَوَّىٰهَا
Sentence structure
فَكَذَّبُوهُ and فَعَقَرُوهَا have attached plural subjects and attached objects. فَدَمْدَمَ has رَبُّهُم as subject; عَلَيْهِمْ and بِذَنۢبِهِمْ are linked to it. فَسَوَّىٰهَا is coordinated, with understood subject and هَا as object.
Ayah summary
They denied the messenger and killed the she-camel, so their Lord destroyed them all because of their sin.
فَكَذَّبُوهُ — But they denied him
Grammar: فَ resumes; كَذَّبُو is Form II plural perfect, attached وا subject and attached هُ object.
فَعَقَرُوهَا — and they hamstrung her
Grammar: فَ coordinates; عَقَرُو is a plural perfect, attached وا subject and attached هَا object.
فَدَمْدَمَ — So destroyed
Grammar: فَ is causative/resultative; دَمْدَمَ is a third-person masculine-singular perfect whose subject is رَبُّهُم.
عَلَيْهِمْ — them
Grammar: عَلَىٰ is a preposition and attached هِمْ a masculine-plural genitive pronoun; the phrase links to دَمْدَمَ.
رَبُّهُم — their Lord
Grammar: A masculine nominative subject of دَمْدَمَ; attached هُمْ is its possessor.
بِذَنۢبِهِمْ — for their sin
Grammar: بِ is a preposition, ذَنۢبِ a masculine genitive noun, and هِمْ its possessor; the phrase links to دَمْدَمَ.
فَسَوَّىٰهَا — and leveled them
Grammar: فَ coordinates; سَوَّىٰ is Form II with understood subject هُوَ, and attached هَا is object.