In this paper we propose a two-dimensional hidden Markov model (HMM)-based framework for solving the cell tracing problem in a biological image sequence. Given label initialization in the first frame, we model the problem as pixel labeling for every consequent frame. Common Markov random field-based frameworks for this task require a fixed set of labels S = {1, 2, · · · , L}, while in our framework the set of labels or the state-space is spatially adaptive, i.e., available prior information is exploited to identify a smaller state-space that varies from node to node. In the cell tracing problem, specifically, temporal information on cell location in the previous frame is used to reduce the states to a small subset of the complete label set. The substantial reduction in average cardinality of the label set yields benefits not only in terms of computational complexity, but also in the labeling accuracy. The general idea can be broadly applied to many computer vision and image processing problems, where prior knowledge enables local reduction of the state-space. We consider the cell tracing problem on a publicly available challenging biological image dataset, which contains a series of electron microscopy images of high resolution and a large number of objects (neuronal processes) to be traced. Experimental results compare the approach with other recently proposed methods, and show considerable improvement.