We report the first clear detection of X-ray pulsation of magnetospheric origin from a millisecond pulsar, PSR B1821-24, with the Advanced Satellite for Cosmology and Astrophysics. The photon arrival time shows a periodicity of 3.05 ms period, as observed in the radio band. The observed X-ray pulse is double peaked. The pulses are characterized by a sharp temporal profile and hard power-law spectrum with a phase-averaged photon index of ~1.9. These two features are quite similar to the X-ray/ gamma -ray pulses from the Crab pulsar and characteristic of the nonthermal emission from the magnetosphere of the neutron star, but contradictory to the thermal emission from its surface. Since this pulsar has physical parameters completely different from those of young pulsars, we expect these observations to provide significant constraints on models of pulsar magnetospheric emission, which have been developed mostly based on the observations of young pulsars.