GRAVITATIONAL microlensing of quasars has been invoked to account for their observed optical variability 1-3 - the timescale being as short as a few years for microlenses the size of Jupiter moving at approximately 300 km s-1 (ref. 4). But some blazars (conspicuously active quasars) show ultra-rapid variability on timescales as short as 1 hour in the optical 5-7 and 1 day at centimetre wavelengths 8-11. Blazars are known to contain relativistic jets directed within approximately 10-degrees of the line of sight 12, and bright knots in these jets could appear to move superluminally with respect not only to the blazar nucleus but also to any galaxy near the line of sight. We argue here that any such superlumimal motion 13, if microlensed by a star in an intervening galaxy, can produce the requisite ultra-rapid variations, even in the absence of intrinsic flux variations in the jet. Moreover, the same mechanism can naturally account for the commonly observed approximately 1-day variability of compact radio sources at centimetre wavelengths 14.