But he said it should be left up to individual states to decide whether to allow offshore drilling and he noted that his biggest supporter in California, popular Governor Arnold Schwarzenegger, was against the idea.
Environmental groups have long opposed expanded offshore oil drilling, raising concerns about the dangers to fragile ecosystems as well potential for oil spills that could mar the US coastline.
With Americans suffering from record oil prices, both candidates for the Nov 4 election are focusing on the issue.
Mr Obama, addressing supporters in Las Vegas, ridiculed Mr McCain for having said on Monday that offshore drilling would produce no immediate relief to high gasoline prices but could have a beneficial 'psychological impact' on US consumers.
When Mr McCain appeared earlier with Mr Schwarzenegger at the Santa Barbara Museum of Natural History, a group of protesters took issue with the candidate over offshore drilling, chanting 'Get oil out' and holding up such signs as, 'Not off our coast' and 'We can't drill our way out of the energy crisis'.
Inside, during a round-table discussion, Mr McCain heard complaints from a panelist seated beside him, Mr Michael Feeney, executive director of the Land Trust for Santa Barbara County.
Mr Feeney did not specifically mention Mr McCain.
'It makes me nervous to think about those who are proposing to drain America's offshore oil and gas reserves as quickly as possible in hopes of driving down the price of gasoline,' Mr Feeney said. Santa Barbara was the site of a major oil spill in 1969.
Mr Obama, too, criticized Mr McCain's proposal to encourage the building of 45 new nuclear reactors by 2030. He said it lacked a plan for waste storage and was among several energy-strategy ideas that Mr Obama said were 'not serious energy policies'.
Mr McCain quickly returned fire on Mr Obama, saying he had gone from opposing nuclear power to now saying it is worth exploring. 'He has shifted his position on a number of issues since he won the nomination of his party,' Mr McCain said.




