The evolution of thin layers of viscous fluid with compact support is considered in a case where the driving forces are gravity and surface tension gradients (which we initially take to be locally constant). In particular, we examine cases where the contact line may initially advance, but then halts at a finite time. Although this phenomenon of halting contact lines is well known, it appears that there was previously little analytical insight into how this occurs. The approach taken here is to seek self-similar solutions local to both the contact line and the halting time. The analysis is split into two parts, namely, before and after the halting time. By invoking continuity across t = 0 (the halting time) it is possible to give a complete asymptotic description of both the advancing and halting processes. It is further shown that the analysis may be extended to encompass various cases where the surface tension gradient is not constant at the contact line. Finally, details are given of some numerical experiments that act as plausibility tests for the results that have been obtained.