In their first official action since Donald Trump became president, California lawmakers have confirmed a new attorney general who has vowed to defend the state's liberal policies against the Trump administration and a Republican Congress.

Xavier Becerra easily cleared the final hurdle to become the state's top law enforcement official, with a 26-9 vote along party lines in the Democratic-controlled state Senate. Becerra, who represented the Los Angeles area in the US House for more than two decades, will be the state's first Latino attorney general.

Democrats said Becerra will fight to defend California's protections for the gay and lesbian community, women and immigrants.

“He will be a very strong partner for our state to work with the federal government when we can and to resist when we must,” said Senate President Pro Tem Kevin de Leon, a Los Angeles Democrat.

Some Republicans said they voted against him because of his promise to challenge federal policies. Republican Sen. John Moorlach of Costa Mesa says he's worried Becerra will jeopardise billions of dollars in federal funding by antagonising the Trump administration.

Democrats in the Assembly approved Becerra's confirmation earlier this month. Becerra worked as a deputy attorney general for three years before winning an Assembly seat in 1990.

He will replace Kamala Harris, who was elected to the US Senate in November.

Many of California's liberal policies face an uncertain future amid promises by Trump and Republican lawmakers to overhaul the nation's health care, immigration and climate change laws.

“Our state has the law, the grit and the guts to fight for hardworking families,” Becerra told lawmakers at a hearing earlier this month, later adding, “I think the best defence is a good offence.”

The day of Trump's inauguration, the White House was already at odds with the country's most populous state over climate change policy. The White House website said Friday that Trump planned to stop former President Barack Obama's climate action plan to reduce greenhouse gas emissions that cause global warming.

The same day, California regulators ploughed ahead with their own climate change goals, releasing a 157-page plan to reach a target of a 40 percent reduction in emissions from 1990 levels by 2030.

Trump Inauguration protests around the World Show all 14 1 /14 Trump Inauguration protests around the World Trump Inauguration protests around the World Activists from Greenpeace display a message reading "Mr President, walls divide. Build Bridges!" along the Berlin wall in Berlin on January 20, 2017 to coincide with the inauguration of Donald Trump as the 45th president of the United State Getty Trump Inauguration protests around the World An activist holds up a sign at the "We Stand United" rally on the eve of US President-elect Donald Trump's inauguration outside Trump International Hotel and Tower in New York on January 19, 2017 in New York Getty Trump Inauguration protests around the World Protesters burn a U.S. flag and a mock flag with pictures of U.S. President-elect Donald Trump outside the U.S. embassy in metro Manila, Philippines Getty Trump Inauguration protests around the World Filipino protestors hold placcards during a protest rally in front of the US embassy in Manila, Philippines, 20 January 2017. On the eve of President-elect Donald Trump's inaguration as the 45th president of the United States, Filipinos and Fil-Americans held a protest in front of the US embassy in Manila to denounce the incoming US president. Getty Trump Inauguration protests around the World Hong Kong police officers and security guards look on as an anarchist protester belonging to the Disrupt J20 movement sits after using a heavy duty D-lock and motorcycle lock to chain himself to a railing at the entrance gate to the Consulate General of the United States of America in Hong Kong to protest the inauguration of United States President-elect Donald Trump, Hong Kong, China, 20 January 2017. Two activists were arrested and taken away by Hong Kong police during the demonstration. Getty Trump Inauguration protests around the World A banner is unfurled on London's Tower Bridge, organised by Bridges Not Walls - a partnership between grassroots activists and campaigners working on a range of issues, formed in the wake of Donald Trump's election, which aims to build bridges to a world free from hatred and oppression. Getty Trump Inauguration protests around the World Protesters chain themselves to an entry point prior at the inauguration of U.S. President-elect Donald Trump in Washington, DC, U.S. Getty Trump Inauguration protests around the World Bridges Not Walls banner dropped from Molenbeek bridge in Brussels, Belgium, 20 January 2017, in an Greenpeace action part of protests Wolrd protest in solidarity with people in the US, the day Donald Trump sworn in as the 45th President of the United States. Getty Trump Inauguration protests around the World A woman holds an anti-U.S. President-elect Donald Trump placard during a rally in Tokyo, Japan, Getty Trump Inauguration protests around the World A Palestinian protester holds a placard during a demonstration against the construction of Jewish settlements in the occupied West Bank and against US President-elect Donald Trump, on January 20, 2017, near the settlement of Maale Adumim, east of Jerusalem Getty Trump Inauguration protests around the World Banners on North Bridge in Edinburgh as part of the Bridges Not Walls protest against US President Donald Trump on the day of his inauguration Getty Trump Inauguration protests around the World Russian artist Vasily Slonov (L) and his assistant carry a life-sized cutout, which is an artwork created by Slonov and titled "Siberian Inauguration", before its presentation on the occasion of the inauguration of U.S. President-elect Donald Trump, in a street in Krasnoyarsk, Russia Getty Trump Inauguration protests around the World A woman holds a banner during a march to thank outgoing President Barack Obama and reject US President-elect Donald Trump before his inauguration at a park in Tokyo, Japan, 20 January 2017. EPA Trump Inauguration protests around the World Palestinian demonstrators protesting this week against a promise by Donald Trump to re-locate the US embassy to Jerusalem Reuters

Democratic Governor Jerry Brown has called Becerra “battle-tested” from his time in a polarised Congress and said his experience will serve him well in defending California's policies.

In addition to confirming Becerra, Legislative leaders have taken their own steps to challenge the new White House administration. The day after Trump was elected president, de Leon and Assembly Speaker Anthony Rendon issued a joint statement rejecting Trump's campaign message.

“While Donald Trump may have won the presidency, he hasn't changed our values,” they said. “We will lead the resistance to any effort that would shred our social fabric or our Constitution.”

Earlier this month, they hired former US Attorney General Eric Holder to advise them on a legal strategy as they prepare to clash with the Trump administration. Holder's firm will be paid $25,000 a month plus expenses from the Legislature's budget to help lawmakers develop strategies “regarding potential actions of the federal government that may be of concern to the state of California,” according to the contract with Holder.