WASHINGTON  President Bush, reversing a longstanding position, will call on Congress on Wednesday to end a federal ban on offshore oil drilling, according to White House officials who say Mr. Bush now wants to work with states to determine where drilling should occur.

The move underscores how $4-a-gallon gas has become a major issue in the 2008 presidential campaign, and it comes as a growing number of Republicans are lining up in opposition to the federal ban.

The party’s presumptive presidential nominee, Senator John McCain of Arizona, used a speech in Houston on Tuesday to say he now favors offshore drilling, an announcement that infuriated environmentalists who have long viewed him as an ally. Florida’s governor, Charlie Crist, a Republican, immediately joined Mr. McCain, saying he, too, now wants an end to the ban.

Even before the disclosure of Mr. Bush’s decision, the drilling issue caused a heated back-and-forth on the campaign trail on Tuesday, as Mr. McCain sought to straddle the divide between environmentalists and the energy industry, while facing accusations from his Democratic opponent, Senator Barack Obama, that he had flip-flopped and capitulated to the oil industry.