Single-walled carbon nanotubes (SWCNTs) possessing a confined inner space protected by chemically resistant shells are promising for delivery, storage, and desorption of various compounds, as well as carrying out specific reactions. Here, we show that SWCNTs interact with molten mercury dichloride (HgCl2) and guide its transformation into dimercury dichloride (Hg2Cl2) in the cavity. The chemical state of host SWCNTs remains almost unchanged except for a small p-doping from the guest Hg2Cl2 nanocrystals. The density functional theory calculations reveal that the encapsulated HgCl2 molecules become negatively charged and start interacting via chlorine bridges when local concentration increases. This reduces the bonding strength in HgCl2, which facilitates removal of chlorine, finally leading to formation of Hg2Cl2 species. The present work demonstrates that SWCNTs not only serve as a template for growing nanocrystals but also behave as an electron-transfer catalyst in the spatially confined redox reaction by donation of electron density for temporary use by the guests.