The crystal structure of rubidium titanyl phosphate, RbTiOPO 4 ͑space group Pna2 1 ͒, has been refined at room temperature, and at 473, 673, 873, and 973 K, by using single-crystal x-ray-diffraction techniques. The data show a large anharmonic motion of the rubidium ions increasing with temperature. To describe the importance of this motion in the phase-transition procedure and in the ionic conductivity phenomenon, two models are developed. The study of the deviation to the centrosymmetric structure ͑space group Pnan͒ shows that the change towards centrosymmetry of the titanyl groups correlates directly with the observed variation of the second-harmonic generating intensity I 2 of the RbTiOPO 4 crystal versus temperature.