California officially announced Rep. Xavier Becerra as the state’s new attorney general, approving Gov. Jerry Brown’s appointment, according to an article in the San Francisco Chronicle.

Becerra will serve the final two years of the position previously held by Kamala Harris, who was sworn in to the U.S. Senate earlier this month.

Harris spent a good portion of her six years in office fighting for California homeowners, such as supporting the California Homeowner Bill of Rights or fining major banks for their role in the foreclosure crisis.

From the article:

Becerra, a Sacramento native and son of Mexican immigrants, will take the helm as the state finds itself at odds with the proposals and policies of the Trump administration. The state’s anticipated battles with the federal government became a key concern for Democratic lawmakers, who pressed Becerra during confirmation hearings over the past two weeks on how he would handle those potential conflicts.

Republicans in both houses voted against Becerra’s appointment, saying they were concerned about the adversarial and partisan tone taken during the confirmation.

The attorney general position is considered the state’s second-most-powerful appointed position behind the governor.

California is already preemptively trying to build a strong defense against the Trump administration in case the state has to go to court.

At the start of this year, California announced it hired former U.S. Attorney General Eric Holder to “advise the state legislature regarding potential conflicts with the incoming Trump administration.”

“With the upcoming change in administrations, we expect that there will be extraordinary challenges for California in the uncertain times ahead. This is a critical moment in the history of our nation.  We have an obligation to defend the people who elected us and the policies and diversity that make California an example of what truly makes our nation great,” a joint statement from California Senate President pro Tempore Kevin de León, D-Los Angeles, and California Assembly Speaker Anthony Rendon, D-Paramount, Calif., said.