Barack Obama served for at least two years in office.
Barack Obama . Obama represented the 13th District for three terms in the Illinois Senate from 1997 to 2004 , when he ran for the U.S. Senate . Barack Obama served as the 44th President of the United States from 2009 to 2017 .