Abstract The current paradigm for the co-evolution of galaxies and their supermassive black holes postulates that dust-obscured active galactic nuclei (AGNs) represent a transitional phase towards a more luminous and unobscured state. However, our understanding of dusty AGNs and their host galaxies at early cosmic times is inadequate due to observational limitations. Here, we present JWST observations of CID-931, an X-ray-detected AGN at a spectroscopic redshift of $z_{\rm spec}=4.91$. Multiband NIRCam imaging from the COSMOS-Web program reveals an unresolved red core, similar to JWST-discovered dusty AGNs. Strikingly, the red core is surrounded by at least eight massive star-forming clumps spread over ${1{^{\prime \prime}_{.}}6} \approx 10\,\,{\rm kpc}$, each of which has a stellar mass of $10^9$–$10^{10}\, M_{\odot }$ and a radius of $\sim$0.1–1 kpc. The whole system amounts to $10^{11}\, M_{\odot }$ in stellar mass, higher than typical star-forming galaxies at the same epoch. In this system, gas inflows and/or complex merger events may trigger clump formation and AGN activity, thus leading to the rapid formation of a massive galaxy hosting a supermassive black hole. Future follow-up observations will provide new insights into the evolution of the galaxy–black hole relationship during such transitional phases in the early universe.