As the diagram shows, fragmentation happens along the path, as needed. It is up to the end-device to reassemble any fragments.
Notice in the drawing how the colored boxes (representing IP packets) are fragmented by the first hop router, and they remain fragmented upon leaving the second hop router. Device B is responsible to reassemble the fragment into the IP packets before passing the reassembled packets to the upper-layer protocols.
**Note:**
This is only for IPv4. IPv6 requires the sending host to pre-fragment any IPv6 packets before sending them since the intermediate devices will not fragment the IPv6 packets.