Aims. We present a multiwavelength analysis of the infrared dust bubble S 24 and the extended IR sources G341.220-0.213 and G341.217-0.237 located in its environs. We aim to investigate the characteristics of the molecular gas and the interstellar dust linked to them and analyze the evolutionary state of the young stellar objects identified there and the relation of the bubble to S 24 and the IR sources. Methods. Using the APEX telescope, we mapped the molecular emission in the CO(2−1), 13 CO(2−1), C 18 O(2−1), and 13 CO(3−2) lines in a region of about 5 × 5 in size around the bubble. The cold dust distribution was analyzed using submillimeter continuum images from ATLASGAL and Herschel. Complementary IR and radio data at different wavelengths were used to complete the study of the interstellar medium in the region. Results. The molecular gas distribution shows that gas linked to the S 24 bubble and to G341.220-0.213 and G341.217-0.237 has velocities of between −48.0 km s −1 and −40.0 km s −1 , compatible with the kinematical distance of 3.7 kpc that is generally adopted for the region. The gas distribution reveals a shell-like molecular structure of ∼0.8 pc in radius bordering the S 24 bubble. A cold dust counterpart of the shell is detected in the LABOCA and Herschel-SPIRE images. The weak extended emission at 24 μm from warm dust and radio continuum emission projected inside the bubble indicates exciting sources and that the bubble is a compact Hii region. Part of the molecular gas bordering the S 24 Hii region coincides with the extended infrared dust cloud SDC341.194-0.221. A molecular and cold dust clump is present at the interface between the S 24 Hii region and G341.217-0.237, shaping the eastern border of the IR bubble. The arc-like molecular structure encircling the northern and eastern sections of the IR source G341.220-0.213 indicates that the source is interacting with the molecular gas. The analysis of the available IR point source catalogs reveals some young stellar object candidates linked to the IR-extended sources, thus confirming their nature as active star-forming regions. Gas and dust masses were estimated for the different features. The total gas mass in the region and the H 2 ambient density amount to 10 300 M and 5900 cm −3 , indicating that G341.220-0.213, G341.217-0.237, and the S 24 Hii region are evolving in a high-density medium. A triggering star formation scenario for the Hii region is investigated.