 He was elected prothonotary of Bradford County in 1893 and reelected in 1896.He was appointed assistant United States district attorney for the middle district of Pennsylvania in 1903.Lilley was elected as a Republican to the Fifty-ninth Congress.