"Terrorist groups intended to detonate car bombs in Baghdad on Tuesday morning," Qassim Atta, a spokesman for the city's military command, said in a statement.
"The security measures were imposed to protect civilians, which included shutting off many roads and taking steps to find the suspected cars," Atta said.
Hundreds of checkpoints were set up throughout the city, in measures not seen since the peak of violence in the country in 2006 and 2007.
The lockdowns caused gridlock of vehicles on roads into the city. Many people were forced to travel by foot, while police helicopters flew overhead.
Bridges into the centre of the city had been closed due to the alleged bomb plot but were reopened by 9.15am (0615GMT).
The plot targeted "sensitive government sites", Ali al-Dabbagh, a government spokesman, said.
Mohammed al-Askari, the defence ministry spokesman, said that security forces had received "tips about places [where people were making] car and vest bombs," that led to the raids.
Co-ordinated vehicle explosions killed almost 400 people and injured another 1,000 in Baghdad in August, October and December.
Government opponents have switched from targeting so-called soft targets in civilian areas to hard targets, for instance government buildings, in the last year.
The general elections in March will be the second since the ouster of Saddam Hussein in 2003 after a US-led invasion.