Barack Obama was the junior US Senator from Illinois when he ran for President. Prior to that he was a Illinois state senator from 1997 until 2004 when he was elected into the US Senate. Before that, Mr. Obama was an attorney in a Chicago law firm, a community organizer and a visiting fellow at the University of Chicago. Related Questions.