The crystal structure of anhydrous K4V2O7 (I) is determined by powder X-ray diffraction. The compound crystallizes in the monoclinic system (a = 10.222(1) Å, b = 6.2309(8) Å, c = 7.282(1) Å, β = 101.31(1)°, space group C2/m, Z = 2). The structure contains layers of isolated V2O7 pyrovanadate groups separated by layers of potassium cations. The hydration and dehydration of I are studied by thermal analysis and high-temperature X-ray diffraction. The dehydration is accompanied by decomposition of the starting crystal hydrate to give intermediate compounds. Anhydrous compound I undergoes a reversible phase transition at 740°C. The high-temperature phase is assumed to have a hexagonal unit cell (a = 6.169(4) Å, c = 15.72(1) Å, Z = 2).