A lithographic apparatus is disclosed that has a heater configured to supply energy to a patterning device to heat the patterning device to form a desired thermal distortion pattern of the patterning device and a controller configured to effect an optical correction in the apparatus corresponding to the desired thermal distortion pattern to reduce the effect of thermal distortion of the patterning device on a pattern.