An anisotropic lattice anomaly near the superconducting transition temperature, Tc, was observed in MgB2 by high-resolution neutron powder diffraction. The a-axis thermal expansion becomes negative near Tc, while the c-axis thermal expansion is unaffected. This is qualitatively consistent with a depletion of the boron-boron s-band as the superconducting gap opens, resulting in weaker bonding. However, the observed anomaly is much larger than predicted by the Ehrenfest relation, strongly suggesting that the phonon thermal expansion also changes sign, as commonly observed in hexagonal layered crystals. These two effects may be connected through subtle changes in the phonon spectrum at Tc.