Democratic gubernatorial candidate Terry McAuliffe now supports exploring for oil off the coast of Virginia, reversing his position on an issue that both sides of the debate consider to be crucial to the commonwealth’s long-term energy future.

When McAuliffe ran for governor in 2009 he said he would back “exploratory drilling for natural gas only“ and did “not support drilling for oil off our coast,” a fact that Republicans cite often in arguing that the Democrat is on the wrong side of the issue. But now that he’s running for governor again, facing Attorney General Ken Cuccinelli II (R) in November, McAuliffe has a different stance.

“Terry has learned more about offshore drilling from experts in Virginia,” said McAuliffe spokesman Josh Schwerin. “He thinks that because of technological progress we can now do it in a responsible fashion.”

McAuliffe’s change of heart means he supports legislation introduced Wednesday by Virginia Sens. Mark Warner (D) and Timothy M. Kaine (D) that would allow oil and gas exploration off the coast of Virginia, with the state keeping a portion of any revenue generated. Rep. Scott Rigell (R-Va.) has introduced a slightly different version of the bill in the House.

Gov. Robert McDonnell (R) and Cuccinelli both said they also supported the measure, which Warner also introduced — with then-Sen. James Webb (D-Va.) — in the last Congress. Lawmakers from both parties have expressed frustration with the Obama administration, which released a five-year plan for offshore drilling last year that excluded Virginia, postponing drilling off the commonwealth’s coast until at least 2017.

“Virginia must have an all-of-the-above energy strategy that includes developing our state’s offshore resources including natural gas, wind, and oil,” Cuccinelli said Wednesday.

America Rising, a pro-Republican opposition research group, has already attacked McAuliffe for having “flip-flopped” on the issue, as McAuliffe said in March that would back “responsible” offshore drilling.

Environmental groups, meanwhile, remain opposed to offshore drilling.

“It is disappointing that so many Virginian politicians of both parties seem willing to jeopardize our strong coastal tourism and fisheries industries for a policy of drill everywhere and burn it all now that ignores environmental, climate and national security concerns,” said Glen Besa, the senior director of the Sierra Club’s Virginia chapter.