SACRAMENTO, Calif. (Reuters) - California lawmakers voted to become a sanctuary state, tussled over hot-button environmental issues and urged other states to refuse to cooperate with President Donald Trump’s Election Integrity Commission as their legislative year ended early on Saturday.

Slideshow ( 2 images )

The majority Democratic lawmakers headed back to their districts having positioned the state in opposition to conservative policies proposed by the Republican-dominated U.S. Congress and President Donald Trump on immigration, the environment and other issues.

“It’s a purposeful positioning,” said political analyst Sherry Bebitch Jeffe, a senior fellow at the University of Southern California. “We have a different political path and a different ideological path than the Republican-controlled Congress and White House have.”

This year, California lawmakers have strengthened protections for undocumented immigrants, increased the gasoline tax and extended a program aimed at compelling businesses to reduce air pollution, all in opposition to federal policies.

Early on Saturday, lawmakers gave last-minute support to a bill barring local governments from forcing undocumented immigrants to spend extra time in jail just to allow enforcement officers to take them into their custody.

The bill, a compromise from a version that sought to severely restrict interactions between law enforcement and immigration officials, does allow communities to notify the federal government if they have arrested an undocumented immigrant with a felony record. It also allows enforcement agents access to local jails.

It came a day after a federal judge barred the U.S. Justice Department from denying public-safety grants to so-called sanctuary cities in retaliation for limiting cooperation with the Trump administration’s crackdown on illegal immigration.

The bill goes now to Democratic Governor Jerry Brown for his signature.

Trump issued an executive order in January targeting funding for cities that offer illegal immigrants safe harbor by declining to use municipal resources to enforce federal immigration laws. A San Francisco judge blocked the order.

Illinois’ Republican Governor signed a bill last month protecting people from being detained because they are the subject of an immigration-related warrant.

FOSSIL FUELS

Although California lawmakers have enacted several environmental protections this year, a measure aimed at weaning the state’s power grid entirely off fossil fuels by 2045 died for the year after lawmakers adjourned without voting on it.

California's three investor-owned utilities, Pacific Gas & Electric PCG_pa.A, Southern California Edison SCE_pe.A and San Diego Gas & Electric [SDGE.UL], said the bill does not protect customers from the cost of switching from fossil fuels.

Assemblyman Chris Holden, who held the measure in his Utilities and Energy Committee, said he would consider it again when the legislature returns in January for the second half of their two-year session.

The legislature also passed a package of bills aimed at increasing the availability of affordable housing in the notoriously expensive state, and approved a plan for spending $1.5 billion in income from the state’s cap-and-trade air quality program, which raises money by selling businesses limited rights to emit pollutants.

They passed a resolution condemning the election integrity commission, calling it an effort to suppress the voting rights of minorities and others, and voted to move up the state’s presidential primary from June to March.