We study, both experimentally and theoretically, the fluid flow driven by a thermocapillary effect applied to a partially contaminated interface in a two-dimensional slot of finite extent. The contamination is due to the presence of an insoluble surfactant which is convected by the flow forming a stagnant zone by the colder edge of the interface. The thermocapillary surface stress is produced by a special optocapillary system, which makes it possible, first, to get an almost linear temperature profile along the interface and, second, to apply a surface pressure large enough to force the surfactant to experience a phase transition to a more condensed state. This enabled us for the first time since the release of the paper by Carpenter & Homsy (J. Fluid Mech., vol. 155, 1985, pp. 429–439) to test experimentally their theoretical predictions and obtain new results for the case when the contamination exists simultaneously in two phase states within the interface. We show that one part of the surface is free of surfactant and subject to vigorous thermocapillary flow, while another part is stagnant and subject to creeping flow with a surface velocity which is approximately two orders of magnitude smaller. We found that the extent of the stagnant zone theoretically predicted earlier does not coincide with the newly obtained experimental data. In this paper, we suggest analytical and numerical solutions for the position of the edge of the stagnation zone, which are in perfect agreement with the experimental data.