Obama sought re-election for a second term in 2012, running virtually unopposed in the Democratic primaries. His opponent in the general election was former governor of Massachusetts Mitt Romney. Obama won 332 electoral votes, defeating Romney who gained 206.