John McCain and Barack Obama drilled each over energy yesterday. McCain called Obama a Jimmy Carter clone for proposing an oil-profits tax, while Obama blasted McCain as a toady of oil barons.

Speaking in Houston, where many energy companies are headquartered, McCain said of Obama, “He supports new taxes on oil producers. He wants a windfall-profits tax on oil, to go along with the new taxes he also plans for coal and natural gas.

“If the plan sounds familiar, it’s because that was President Jimmy Carter’s big-idea tool – and a lot of good it did us.

“I’m all for recycling – but it’s better applied to paper and plastic than to the failed policies of the 1970s.”

At the same time, McCain tried to show he’s an environmentally friendly Republican, unveiling a TV campaign ad that boasts he “stood up” to President Bush five years ago by pushing for legislation to address climate change.

But positions of opposing drilling in the Alaska National Wildlife Arctic Reserve – while supporting more offshore drilling to boost domestic production and reduce reliance on foreign oil – drew fire from liberal critics who said he’s contradicting himself.

Obama opposes offshore drilling and defended his proposed tax, saying he believes in a “windfall profits tax . . . to ease the burden of higher energy costs on working families.”

“Instead of giving oil executives another way to boost their record profits, I believe we should put in place a windfall-profits tax that will . . . ease the burden of higher energy costs on working families,” he said.

Meanwhile, McCain’s campaign accused Obama of having a dangerous and naive “Sept. 10” mindset toward terrorism because the Democrat spoke out against the detention of terror suspects at Guantanamo Bay.

Team McCain released a statement from Rudy Giuliani, who said, “Barack Obama appears to believe that terrorists should be treated like criminals – a belief that underscores his fundamental lack of judgment regarding our national security. In a post-9/11 world, we need to remain on offense.”

Obama said the GOP was practicing the politics of fear.

carl.campanile@nypost.com