SACRAMENTO — With President Obama back from a trip to Alaska in which he portrayed the fight against climate change as an urgent international priority, California is showing how hard it can be — even in a state overwhelmingly controlled by Democrats — to get an ambitious carbon reduction bill passed.

The state has been at the forefront of global efforts to battle greenhouse gases, enacting mandates to force sharp reductions in emissions over the next 35 years. Its environmental record was applauded by Mr. Obama last week, and Pope Francis invited Gov. Jerry Brown to discuss the fight against global warming in the Vatican this summer.

But a centerpiece of California’s long-term campaign against emissions — legislation requiring a 50 percent reduction in petroleum use by Jan. 1, 2030 — has set off a fierce battle here, pitting not only a well-financed oil industry against environmentalists, but Democrat against Democrat. The bill easily passed the Senate, but it is faltering in the Assembly because of opposition by moderate Democrats, many representing economically suffering districts in central California. A vote is expected early this coming week.

The legislation faces an onslaught by the Western States Petroleum Association and other oil industry advocates that, in ads and mailings, assert that a 50 percent cut in petroleum use could result in gas rationing and a ban on minivans.