The crystal structure of the potassium salt of raltegravir has been solved and refined using synchrotron X-ray powder diffraction data, and optimized using density functional techniques. Raltegravir potassium crystallizes in space group P21/c (#14) with a = 15.610 59(9), b = 8.148 19(3), c = 16.125 97(6) Å, β = 94.1848(5)°, V = 2045.72(1) Å3, and Z = 4. The most prominent feature of the crystal structure is the chains of edge-sharing 7-coordinate KO5N2 parallel to the b-axis. The crystal structure can be described as having K-containing layers in the bc-plane, with double layers of CH4F halfway between them. The raltegravir anion is not in the minimum-energy conformation, suggesting that coordination to the K and hydrogen bonds play a significant role in the solid-state structure. The powder pattern is included in the Powder Diffraction File™ as entry 00-064-1499.