The invaded cluster algorithm, a new method for simulating phase transitions, is described in detail. Theoretical, albeit nonrigorous, justification of the method is presented and the algorithm is applied to Potts models in two and three dimensions. The algorithm is shown to be useful for both first-order and continuous transitions and evidently provides an efficient way to distinguish between these possibilities. The dynamic properties of the invaded cluster algorithm are studied. Numerical evidence suggests that the algorithm has no critical slowing for Ising models.