A triaxial accelerometer worn on the thigh can provide information on the angle of rotation of the thigh. These data may be used to estimate periods of lying versus sitting. Purpose To develop and test a classification algorithm to identify sedentary events as either lying or sitting events using a thigh-worn, triaxial accelerometer. Methods Seven-day free-living activity from 14 sedentary workers was recorded using the activPAL3™ monitor. Participants recorded when they went to bed and when they got up in a diary. All "in-bed" sedentary events were assumed to be lying and all "not-in-bed" sedentary events as sitting. An algorithm computed the angle of rotation of the y-axis, which was used to detect orientation of the thigh. Crossing a rotational threshold in the transverse plane of ±65° was used to classify a sedentary event as lying. The classification accuracy of the algorithm was compared with self-reported classification from the diary. Results The algorithm classified 96.7% of the sedentary time "in bed" (sensitivity) as lying and 92.9% of the time "not in bed" as not lying (specificity). Conclusions Triaxial accelerometer data recorded from a single site on the thigh can be used to classify sedentary events as sitting and lying. The automated method developed in this study will allow objective measurement of diurnal lying time and that while sleeping without relying on self-report. This will help advance the understanding of the impact of different types of sedentary behaviors on various health outcomes.