S3 is one of the basic allotropes of sulfur but is still a mysterious labile species. We selectively trapped S3 in a pore of a thermally stable coordination network and determined S3 structure by ab initio X-ray powder diffraction analysis. S3 in a pore has a C2v bent structure. The network containing trapped S3 is remarkably stable under ambient conditions and is inert to photoirradiation. S3 in the network could be transformed to S6 by mechanical grinding or heating in the presence of NH4X (X = Cl or Br). S6 could be reverse-transformed to S3 by photoirradiation. We also determined the structure of the network containing S6 by ab initio X-ray powder diffraction analysis.