A model is formulated of a two-dimensional migrating, or swimming, inviscid bubble in a viscous fluid whose unsteady displacement is caused by the spreading over its surface of an initial distribution of insoluble surfactant. Assuming small capillary and Reynolds numbers, and a linear equation of state giving the surface tension as a function of surfactant concentration, the quasi-steady Stokes flow around the bubble is found analytically and explicit formulas are determined for the time-dependent bubble speed and its final overall displacement. At infinite surface Péclet number this is done using a complex version of the method of characteristics to solve a complex partial differential equation of Burgers type. For a finite non-zero surface Péclet number, the problem is shown to be linearizable by a complex variant of the classical Cole–Hopf transformation. The formulation allows general statements to be made on the bubble speed and its total net displacement in terms of the initial surfactant distribution. A weak finite-time singularity in the surface activity associated with an isolated clean point on the bubble surface is also identified and studied in detail.