Washington: A defiant Barack Obama challenged his Republican opponent over which presidential candidate would keep the US safer, delivering a sharp rebuke to John McCain's aides who said the Democratic challenger had a naive approach toward fighting terrorism.

Obama and McCain also clashed over energy policies. McCain accused his Democratic opponent of recycling impractical ideas by supporting a tax on windfall oil company profits. Obama criticised his rival's proposed energy plan which called for an end to a federal moratorium on offshore oil drilling.

The rival camps engaged in a war of words on national security on Tuesday that echoed the 2004 presidential campaign in which President George W. Bush, Vice President Dick Cheney and other Republicans argued that Democratic nominee John Kerry was soft on terror, a claim that resonated with voters and helped propel Bush to re-election. Democrats complained that the Republican Party was using the politics of fear.

The Republican argument proved less effective in 2006 when then Bush adviser Karl Rove said the Democrats had a pre-September 11 view of the world and Republicans had a post-September 11 terror attacks perspective. In November of that year, Democrats captured enough congressional seats to seize control of the House and Senate.

"These are the same guys who helped to engineer the distraction of the war in Iraq at a time when we could have pinned down the people who actually committed 9/11," Obama told reporters aboard his campaign plane. "This is the same kind of fear-mongering that got us into Iraq ... and it's exactly that failed foreign policy I want to reverse."

Obama's remarks came after McCain aides criticised the Democratic candidate for talking about using the criminal justice system to prosecute terrorists, as opposed to resorting to indefinite detention of suspects.