Magnetoelastic dilatometry of the piezomagnetic antiferromagnet UO2 was performed via the fiber Bragg grating method in magnetic fields up to 150 T generated by a single-turn coil setup. We show that in microsecond timescales, pulsed-magnetic fields excite mechanical resonances at temperatures ranging from 10 to 300 K, in the paramagnetic as well as within the robust antiferromagnetic state of the material. These resonances, which are barely attenuated within the 100-µs observation window, are attributed to the strong magnetoelastic coupling in UO2 combined with the high crystalline quality of the single crystal samples. They compare well with mechanical resonances obtained by a resonant ultrasound technique and superimpose on the known nonmonotonic magnetostriction background. A clear phase shift of π in the lattice oscillations is observed in the antiferromagnetic state when the magnetic field overcomes the piezomagnetic switch field Hc=−18 T. We present a theoretical argument that explains this unexpected behavior as a result of the reversal of the antiferromagnetic order parameter at Hc.