The pressure-response of the Co-O bond lengths and the spin state of Co ions in a hybrid 3d-5d solid-state oxide Sr2Co0.5Ir0.5O4 with a layered K2NiF4-type structure was studied by using hard X-ray absorption and emission spectroscopies. The Co-K and the Ir-L 3 X-ray absorption spectra demonstrate that the Ir5+ and the Co3+ valence states at ambient conditions are not affected by pressure. The Co Kβ emission spectra, on the other hand, revealed a gradual spin state transition of Co3+ ions from a high-spin (S = 2) state at ambient pressure to a complete low-spin state (S = 0) at 40 GPa without crossing the intermediate spin state (S = 1). This can be well understood from our calculated phase diagram in which we consider the energies of the low spin, intermediate spin and high spin states of Co3+ ions as a function of the anisotropic distortion of the octahedral local coordination in the layered oxide. We infer that a short in-plane Co-O bond length (<1.90 Å) as well as a very large ratio of Co-Oapex/Co-Oin-plane is needed to stabilize the IS Co3+, a situation which is rarely met in reality.