Based on the existence of ATP-sensitive potassium channels in the plasma membrane of pancreatic beta cells, we develop a quantitative explanation of the electrical activity observed in pancreatic islets. The proposed mechanism involves the voltage-dependent inward calcium and outward potassium currents described by Rorsman and Trube (1986), which are voltage-activated when an increase in the cytoplasmic ATP/ADP ratio decreases the conductance of the ATP-sensitive potassium channels. It is proposed that modulation of the ATP/ADP ratio occurs through calcium inhibition of oxidative phosphorylation. In this picture the mitochondria serve as a transducer of metabolic activity whose sensitivity is modulated by cytosolic calcium. Solution of the differential equations that describe this mechanism gives rise to both bursting and continuous spiking electrical activity similar to that observed experimentally. While the mechanism for bursting in this model involves the ATP/ADP ratio, the feedback is still provided by calcium, as originally proposed by Chay and Keizer (1983) using a Ca2+-activated potassium conductance. A mixed-model, which includes both ATP-sensitive and Ca2+-activated potassium conductances, also reproduces the experimentally observed electrical activity and may correspond more closely to the actual situation in vivo.