Hybrid metal halide materials with charming phase transition behaviors have attracted considerable attention. In former works, much attention has been focused on the phase transition triggered by the order-disorder or displacement motions of the organic component. However, manipulating the variation of the inorganic component to achieve the phase transition has rarely been reported. Herein, two novel organic-inorganic hybrid materials, [THPM]n[AgX2]n (THPM = 3,4,5,6-tetrahydropyrimidin-1-ium, X = I for 1 and Br for 2) with the [AgX2]nn- anionic chain structure, were synthesized. At 293 K, the [AgX2]nn- chains in 1 were constructed by the tetramer units of Ag atoms, while that in 2 was assembled by the dimer structure. Upon heating to 355 K, owing to the variation of the metallophilic interaction between adjacent Ag atoms, a unique transformation process from tetramer to dimer in [AgI2]nn- chains of 1 can be detected and endow 1 with a giant anisotropic thermal expansion with linear strain of ∼7% and shear strain of ∼20%, which can be used as a mechanical actuator for switching. Alternatively, for 2, no phase transition process can be observed upon the temperature variation. This work provides an effective approach to design phase transition materials triggered by the inorganic part.