The presumptive Republican nominee, meanwhile, defended an Internet advertisement mocking the Democratic presidential candidate as a presumptuous messianic figure, saying it was important to "display a sense of humor" in the presidential contest.
The rapid fire developments Friday capped a week of campaigning in which the two White House hopefuls sharpened their attacks on each other, escalating the rhetoric and prompting each campaign to accuse the other of injecting race into the presidential debate.
Obama, who has campaigned on a platform of change, previously ridiculed a push by Republicans to open offshore areas to oil exploration in a bid to bring down surging energy prices. The country's economic woes have largely eclipsed other issues in the presidential race.
The first term Illinois senator, in comments echoed by other critics of the proposal, had argued that any new oil found would take years to come onto the market and that conservation and fuel-efficient vehicles were a quicker solution to soaring costs.
But Obama told a Florida newspaper in an interview that he could support a compromise with Republicans and oil companies to prevent gridlock over energy.
"My interest is in making sure we've got the kind of comprehensive energy policy that can bring down gas prices," Obama said in an interview with The Palm Beach Post.
"If, in order to get that passed, we have to compromise in terms of a careful, well thought-out drilling strategy that was carefully circumscribed to avoid significant environmental damage - I don't want to be so rigid that we can't get something done."
McCain, who has repeatedly accused Obama of vacillating on the issues, reiterated that his opponent doesn't have a plan equal to the country's energy challenges.
"We need oil drilling and we need it now offshore. He has consistently opposed it. He has opposed nuclear power. He has opposed reprocessing. He has opposed storage," McCain said.
Later, Obama welcomed a compromise proposal sent to Senate leaders Friday by 10 senators - five from each party - that seeks to break the impasse over offshore oil development and is expected to be examined more closely in September after Congress returns from its summer recess.
Earlier in the day, Obama pushed for a windfall profits tax to fund $1,000 emergency rebate checks for consumers besieged by high energy costs, a counter to McCain's call for more offshore drilling.
McCain had been criticizing Obama for continuing to oppose the plan as retail gasoline prices hit record levels in the U.S. Polls indicate these attacks have helped McCain gain ground on Obama.
Energy prices have become the catalyst in a presidential election where the economy has emerged as the top priority for American voters.
Both candidates have tried to cast themselves as having the answers.
While Obama paints McCain as little more than an extension of President George W. Bush's unpopular presidency, the veteran Arizona senator maintained that his rival was an inexperienced elitist who would much rather sound the trumpet of change than actually enact any reforms.
McCain's new ad appearing on the Web, marked the Republican's latest attempt at ridiculing his opponent, whose ability to draw crowds by the tens and hundreds of thousands has been unmatched by McCain.
In the ad, a voiceover calls Obama "The One." It features clips of Obama appearing to describe himself and his presidential quest in grandiose terms and ends with Charlton Heston as Moses parting the Red Sea in the movie, "The Ten Commandments."
The ad was McCain's latest attempt to caricature his rival as an empty media phenomenon, coming on the heels of the campaign's new television ad juxtaposing Obama with lightweight celebrities Britney Spears and Paris Hilton.
Obama spokesman Hari Sevugan slammed the Web ad, which he likened to "juvenile actions."
McCain brushed off complaints from critics and some supporters that his tone had become too negative.
"We think it's got a lot of humor in it, we're having fun and enjoying it ... we'll continue to fight and scrap all the way to November 4," he said, referring to the date of the presidential election.
McCain also reiterated his contention that Obama, who would be America's first black president, had injected race into the campaign, a day after McCain's campaign manager accused the Illinois senator of "playing the race card" by suggesting Republicans were trying to scare voters away from voting for him because he "doesn't look like all those other presidents on the dollar bills."
"I didn't bring up the issue. Senator Obama did," McCain insisted.
Addressing an influential black organization in Orlando, Florida, McCain said Friday that Obama appeared to be more willing to wax poetic about change than actually embrace it.
McCain, in a speech to the National Urban League, which Obama will address Saturday, criticized his rival for choosing private over public schools for his children. McCain, too, sent his children to private schools. But he argues that unlike Obama, he favors vouchers that give parents more school choices.
McCain's criticism of Obama to the group echoed the Republican theme that Obama's words do not always match his actions or his thin resume.
"If there's one thing he always delivers it's a great speech," McCain said. "But I hope you'll listen carefully, because his ideas are not always as impressive as his rhetoric."