The Casimir force is the attraction between uncharged metallic surfaces as a result of quantum mechanical vacuum fluctuations of the electromagnetic field. We demonstrate the Casimir effect in microelectromechanical systems using a micromachined torsional device. Attraction between a polysilicon plate and a spherical metallic surface results in a torque that rotates the plate about two thin torsional rods. The dependence of the rotation angle on the separation between the surfaces is in agreement with calculations of the Casimir force. Our results show that quantum electrodynamical effects play a significant role in such microelectromechanical systems when the separation between components is in the nanometer range.