Thiospinel AgIn5S8 as a visible-light-active semiconductor has been frequently used as a photoabsorber in solar cells, optoelectronics devices, and photoelectrochemical cells. Similar to temperature, pressure is an efficient external stimulus for both crystalline structural and electronic modulations to improve properties. Herein, we present the pressure tuning effect on AgIn5S8 up to 40 GPa. A pressure-driven phase transition from the ambient cubic spinel structure to an orthorhombic structure is observed around 10 GPa as evidenced from the in situ high pressure synchrotron X-ray diffraction results. The high pressure phase of AgIn5S8 adopts the defective LiVO2-type structure with all the Ag+/In3+ cations sitting in the octahedrally coordinated environments. Both the electric transport and photocurrent measurements show dramatic changes along with the phase transition around 10 GPa, and the high pressure phase of AgIn5S8 exhibits greatly improved conductivity but decreased responses to visible light illumination. Surprisingly, the in situ UV-vis measurements reveal the onset pressure point of bandgap evolution around 7.5 GPa, far below the structural phase transition pressure around 10 GPa, which indicates the early initiated local structural change in the pressure range 7.5-10 GPa. An in situ Raman technique is used to confirm the coordination environment changes of AgIn5S8 under compression, the results of which reveal the coexistence of both the ambient and the high pressure structure features of AgIn5S8 in the pressure range 7.5-10 GPa. This work provides a demonstration on how external pressure affects the crystal structure, electronic structure, and optical properties of chalcogenide semiconductors and sheds light on the structure design of better optoelectrical materials under ambient conditions.