Obama worked for Alice Palmer, an Illinois state senator. In 1995 she chose not to run for re-election so that she could run for U.S. Congress, and Obama decided to run for her Illinois state senate seat. Palmer lost her election for U.S. Congress, so she tried to keep her seat in the state senate, but she did not have enough time to meet the rules of the election. Obama's team said that she could not be on the ballot, and the election rulemakers agreed. Obama won the election and became an Illinois state senator. He was state senator from 1997 to 2004.