Massachusetts held a special election to fill a vacancy in Massachusetts's 5th congressional district on October 16, 2007. Democrat Niki Tsongas won election to Congress, defeating Republican Jim Ogonowski in an election that was closer than expected. A primary election was held on September 4, 2007 to determine each political party's nominee for the general election. Niki Tsongas won the Democratic nomination and Jim Ogonowski won the Republican nomination. Tsongas won the general election, held on October 16, 2007, with 51% of the vote; Ogonowski received 45%.