 He served as a member of the Pennsylvania House of Representatives from 1797 to 1800.He served in the Pennsylvania State Senate from 1801 to 1804 and was speaker of the Senate in 1804 during the impeachment trials of the judges of the Supreme Court of Pennsylvania.Whitehill was elected to the Ninth Congress to fill the vacancy caused by the death of John A. Hanna.