High-resolution x-ray-absorption (XAS) experiments in the partial fluorescence yield mode (PFY) and resonant inelastic x-ray emission (RXES) measurements were performed on the intermediate-valence compound YbAl3 under pressure of up to 38 GPa. The results of the YbAl3 PFY-XAS and RXES studies show that the valence of Yb increases smoothly from 2.75 at ambient pressure to 2.93 at 38 GPa. In situ angle-dispersive synchrotron high-pressure x-ray-diffraction experiments carried out using a diamond cell at room temperature show that the ambient pressure cubic phase is stable up to 40 GPa. The results obtained from self-interaction corrected local spin density-functional calculations to understand the pressure effect on the Yb valence and compressibility are in good agreement with the experimental results. © 2008 The American Physical Society.