The bedrock of Kamala Harris’s U.S. Senate campaign has been her record as California attorney general and as San Francisco district attorney. She has said her experience in those posts provides ample proof that she is the best and most qualified candidate to represent California in Washington.

In those jobs, Harris has often been the focal point of news coverage on high profile events such as investigations into the Santa Barbara County oil spill and Volkswagen cheating on vehicle emission tests. She has directly influenced California’s justice system and sent people to jail.

Her rival in the Senate race, fellow Democrat Rep. Loretta Sanchez of Orange, has been a member of the U.S. House of Representatives for two decades. But with Democrats in power for few of those years, it has been challenging for Sanchez to claim outright ownership of any new federal policies or legislation.

In stump speeches, debates and political ads, Harris has been quick to mention her role in forcing banking Goliaths to cough up $20 billion in mortgage relief. Her work defending same-sex marriage and reducing recidivism among drug offenders also rise to the top of her campaign talking points.

Here are some of the notable milestones in her political career, including some of those steeped in controversy:

1. Helped broker mortgage relief settlement

A foreclosure sign hangs on a fence in front of a foreclosed home in Richmond in 2011. (Photo by Justin Sullivan/Getty Images)

During her first year as California Attorney General, Kamala Harris joined other state attorneys general in brokering a $25-billion nationwide settlement deal with the nation’s five largest mortgage institutions for improper foreclosure practices during the recent housing market crash.

Harris had pulled out of earlier settlement negotiations, as did New York Atty. Gen. Eric Schneiderman. She said the banks weren’t providing enough money for California homeowners and were asking for too much legal protection, and the state received a better settlement as a result.

The financial institutions involved in the national settlement were Bank of America Corp., JPMorgan Chase & Co., Wells Fargo & Co., Citigroup Inc. and Ally Financial Inc.

As a result of the 2012 agreement, California homeowners received $18.4 billion in mortgage relief, according to a September 2013 report by a special settlement monitor appointed by Harris. An additional $2 billion went to refinance assistance and transition payments to people who lost their homes to foreclosure. The relief was given directly to homeowners from the financial institutions and not funneled through the state.

According to the report, $9.2 billion went to reducing principal on first and second mortgages. The financial institutions also reported absorbing $9.2 billion in losses on short sales — when homes are sold at a price lower than the amount homeowners owe on their mortgages.

2. Refused to defend ban on gay marriage

Opponents of Proposition 8 cheer after federal judge in San Francisco overturned California's same-sex marriage ban in 2010. (AP Photo/Eric Risberg)

As state attorney general, Harris refused to defend Proposition 8, a 2008 ballot measure approved by California voters that banned gay marriage, after it was struck down by a federal court.

Gov. Jerry Brown also had refused to appeal the ruling. Both Harris and Brown had criticized the ballot measure as unconstitutional.

Their decisions were significant. In 2013, the U.S. Supreme Court ruled that proponents of the measure did not have the legal standing to defend Proposition 8 on appeal after Harris and Brown had refused to do so. The case was dismissed on technical grounds, removing the ban on same-sex marriage in California.

“I declined to defend Proposition 8 because it violates the Constitution,” Harris said in 2013. “The Supreme Court has described marriage as a fundamental right 14 times since 1888. The time has come for this right to be afforded to every citizen.”

Attorney General Kamala Harris on decision not to defend Proposition 8

In his dissent in the Supreme Court ruling, Justice Anthony M. Kennedy wrote that the decision "disrespects and disparages" California's political process, in which voter initiatives are an important ingredient. He said giving the governor and attorney general “this de facto veto will erode one of the cornerstones of the State’s governmental structure.”

In June 2015, the U.S. Supreme Court held that same-sex couples have a constitutional right to marry.

3. Refused to seek the death penalty against a cop killer

Slain San Francisco Police Officer Isaac Espinoza. (AP Photo/San Francisco Police Dept via The San Francisco Chronicle)

Just four months after Harris started her job as San Francisco district attorney in 2004, city police officer Isaac Espinoza was gunned down by a gang member. Days after the slaying, Harris announced that she would not seek a death sentence for the killer, David Hill, then 22 years old.

Harris stuck to her campaign promise to never pursue the death penalty, which she considered unjust and immoral.

But Democratic U.S. Sens. Dianne Feinstein and Barbara Boxer, then-state Atty. Gen. Bill Lockyer and then-Oakland Mayor Jerry Brown all criticized Harris' decision. Lockyer opened an inquiry into whether Harris abused her discretion by declining to seek a death sentence. Harris was within her legal authority, he found.

Hill was later convicted of second-degree murder and sentenced to life in prison.

While Harris personally opposes the death penalty, when she ran for attorney general in 2010 she promised to enforce and to defend death sentences on appeal. In 2014, Harris appealed an Orange County federal court judge’s decision declaring the state's death penalty system unconstitutional.

4. Delays in confiscating guns from dangerous Californians

The Los Angeles Police Department displays weapons collected during a daylong gun buyback program in May. (Al Seib / Los Angeles Times)

A 2013 state auditor's report criticized the state Department of Justice, overseen Harris, for delays in determining whether potentially dangerous people own guns in violation of state law.

Eighteen months later, the auditor again criticized the Attorney General’s Office for failing to fully implement most of the recommendations auditors had made to reduce the backlog, posing a "continued risk to public safety."

The Justice Department cross-references databases to find people who legally purchased guns before they became ineligible, under state law, because of a severe mental illness or their criminal history. Californians on the banned list have their gun confiscated by law enforcement authorities.

About two-thirds of those barred from firearm ownership are felons or have a violent history. One-third are in the system because of mental illness.

In 2015, more than 33,000 people were on the prohibited list for gun ownership in California and still needed to be investigated. The Justice Department in 2015 blamed the backlog in part on loss of staff and the continued strong sales of firearms in California.

Republican lawmakers, however, said the agency received a special appropriation of $24 million in 2013 to eliminate the backlog.

In January, the Department of Justice reported that it reduced to backlog to 12,691 people from whom guns still must be confiscated. The agency requested additional funding from the California Legislature to cut it further.

5. Sued for-profit Corinthian Colleges for misleading students

Harris sued the for-profit Corinthian Colleges in 2013, accusing the company of false and predatory advertising, securities fraud and intentional misrepresentations to students.

The Santa Ana company was, at the time, one of the world's largest for-profit college businesses and was under investigation by the Securities and Exchange Commission.

The state won a $1.1-billion judgment against the company in March. However, Corinthian closed all of its campuses and filed for bankruptcy protection in 2015, so the chances of recovering that judgement appear remote.

San Francisco Superior Court Judge Curtis Karnow found that Corinthian provided untrue or misleading statements about graduates' job placement rates, duping students and investors.

6. Increased transparency on in-custody deaths, but opposed independent investigations of police shootings

Black Lives Matter protestors disrupt a Los Angeles Board of Police Commissioners meeting in March. (Irfan Khan / Los Angeles Times)

Amid the national debate over racial profiling and use of force following officer-involved shootings in Ferguson, Mo., Cleveland, Baltimore and other cities, Harris launched her agency’s “Open Justice” website in 2015.

The portal provides public access to data on arrest rates, in-custody and arrest-related deaths and law enforcement officers killed or assaulted — breaking the numbers down by race and ethnicity, cause of death and other factors.

Still, some civil rights activists and members of California's Legislative Black Caucus have criticized Harris for opposing legislation that would require her office to independently investigate fatal police shootings, and for not endorsing statewide regulations on the use of police body cameras .

>>

Election 2016 | California politics news feed | Sign up for the newsletter

7. Launched ‘Back on Track’ program to reduce recidivism — with one ‘flaw’

Kamala Harris in 2004, the newly elected San Francisco District Attorney. (Jay and Ani / For The Times)

In 2005, while she was San Francisco district attorney, Harris launched the “Back on Track” program to reduce recidivism by offering nonviolent, low-level drug trafficking defendants job training and other life skills education as an alternative to jail.

Her office had reported that over the first two years, less than 10% of those who graduated from the program were reoffenders — compared to 53% of drug offenders statewide who returned to prison or jail within two years of release.

The San Francisco program has been used as a model across the country. After Harris was elected attorney general in 2010, she created a new division for recidivism reduction and re-entry in the state Department of Justice. In 2015, she launched a “Back on Track LA” pilot program with the Los Angeles Sheriff’s Department.

But while she was still district attorney, the Back on Track program came under criticism for admitting immigrants who were in the U.S. illegally. In 2008, convicted cocaine dealer Alexander Izaguirre avoided prison after being accepted into the program. Izaguirre later stole a woman's purse and then drove into her with an SUV, fracturing her skull.

In 2009, Harris said that allowing immigrants who were in the country illegally into the job training program when they could not legally employed was a "flaw in the design” of the program and that it was quickly fixed. People who could not be legally employed in the U.S. were barred from the jobs program.

8. Veteran of tough campaigns

Before Harris was the frontrunner in California’s U.S. Senate campaign, she had a much more difficult political road when she first ran for San Francisco district attorney in 2003 and then state attorney general in 2010.

Harris, then 39 years old, won a bruising campaign in 2003 to unseat two-term incumbent San Francisco Dist. Atty. Terence Hallinan.

Under Hallinan, conviction rates hovered around 50%, by far the lowest in the state. Prosecutors reported that they lacked simple necessities such as e-mail accounts. Harris briefly worked for Hallinan before she became disillusioned with his leadership and left for the San Francisco city attorney's office.

Hallinan attacked Harris as a cog in the political machine of her mentor and one-time boyfriend Willie Brown, the former Assembly speaker and the city's mayor at the time.

In the 2010 race for attorney general, she beat Republican Steve Cooley, then the Los Angeles County district attorney, by less than 1% of the vote.

Harris cast herself as "smart on crime" and called for new approaches that would reduce recidivism and prison overcrowding. She depicted Cooley as soft on environmental crimes and criticized him for saying he would defend Proposition 8. Cooley called Harris a radical liberal who coddled criminal illegal immigrants and refused to seek the death penalty for a cop killer.

Harris’ message to voters won out. She even beat Cooley in his home county.

phil.willon@latimes.com

Twitter: @philwillon

MORE ON KAMALA HARRIS:

How race helped shape the politics of Senate candidate Kamala Harris

Kamala Harris strengthened, Loretta Sanchez weak as general election begins, new poll finds

Kamala Harris should take bolder action on police shootings, civil rights advocates say

Updates on California politics