In the final months of the Obama administration, Walmart was under pressure from federal officials to pay nearly $1 billion and accept a guilty plea to resolve a foreign bribery investigation.

Barclays faced demands that it pay nearly $7 billion to settle civil claims that it had sold toxic mortgage investments that helped fuel the 2008 financial crisis, and the Royal Bank of Scotland was ensnared in a criminal investigation over its role in the crisis.

The three corporate giants complained that the Obama administration was being unreasonable and stood their ground, according to people briefed on the investigations. After President Donald Trump took office, they looked to his administration for a more sympathetic ear — and got one.

Federal prosecutors and the Securities and Exchange Commission have yet to charge Walmart, and the Justice Department reached a much lower settlement agreement with Barclays in March, for $2 billion. RBS paid a civil penalty, but escaped criminal charges altogether.

Across the corporate landscape, the Trump administration has presided over a sharp decline in financial penalties against banks and big companies accused of malfeasance, according to analyses of government data and interviews with more than 60 former and current federal officials. The approach mirrors the administration’s aggressive deregulatory agenda throughout the federal government.

The New York Times and outside experts tallied enforcement activity at the SEC and the Justice Department, the two most powerful agencies policing the corporate and financial sectors. Comparing cases filed during the first 20 months of the Trump presidency with the final 20 months of the Obama administration, the review found:

— A 62 percent drop in penalties imposed and illicit profits ordered returned by the SEC, to $1.9 billion under the Trump administration from $5 billion under the Obama administration.

— A 72 percent decline in corporate penalties from the Justice Department’s criminal prosecutions, to $3.93 billion from $14.15 billion, and a similar percent drop in civil penalties against financial institutions, to $7.4 billion.

— A lighter touch toward the banking industry, with the SEC ordering banks to pay $1.7 billion during the Obama period, nearly four times as much as in the Trump era, and Trump’s Justice Department bringing 17 such cases, compared with 71.

While career officials in the federal government have continued to investigate wrongdoing at companies large and small, some of the top political appointees under Trump have led a philosophical shift in governing that favors big business and prioritizes the interests of individual investors.

Many Republicans in regulatory and law enforcement roles have resisted corporate penalties, suggesting that they unfairly punish a company’s shareholders for the misconduct of employees. Democratic appointees have more often maintained that shareholders wrongly benefit from ill-gotten gains, no matter who was responsible for them, and that tough penalties could deter future lawbreaking.

If the balance tilted toward a heavier hand in corporate penalties under former President Barack Obama — even as critics argued that his administration did not do enough to punish top bankers after the crisis — it began to swing in the opposite direction under Trump, the data show.

With the exception of the Commodity Futures Trading Commission, a small agency where a new enforcement director has presided over an uptick in penalties and a Trump-appointed chairman vowed “no pause” in enforcement, the new approach extends across the federal financial enforcement regime.

Trump’s pick to lead the Office of the Comptroller of the Currency, a federal banking regulator, is a former executive whose bank once faced an enforcement action, while Trump’s leader of the Consumer Financial Protection Bureau, created by Congress during the Obama administration, initially instituted an informal freeze on new enforcement actions.

The SEC, an independent agency composed of a bipartisan group of presidentially appointed commissioners, is less subject to political considerations. The leaders of the agency’s enforcement division act in a nonpartisan capacity.

Still, Robert J. Jackson Jr., a Democratic commissioner at the SEC who is a former law professor and corporate lawyer, said the philosophy of Republican commissioners sent the wrong message. “We should be trying to deter management from committing fraud, not rewarding corporations when their lawyers cleverly mask bad deeds,” he said.

Former Republican officials have largely welcomed the change, though some are concerned that the Trump administration’s softer approach toward banks could open the door to the sort of reckless Wall Street behavior that spurred the financial crisis, particularly as federal regulators ease some Obama-era rules adopted after the crisis.

“The goal is really to instill in those who are regulated the illusion that the government is everywhere and looking over your shoulder,” said Harvey L. Pitt, a Republican who was chairman of the SEC under President George W. Bush. “If you take away that threat, that could embolden some to keep breaking the law.”

In a statement, the SEC disputed The Times’ approach to assessing the agency’s record.

“The article’s conclusion that enforcement of the federal securities laws has flagged rests on deeply flawed methodology,” said Stephanie Avakian and Steven Peikin, the heads of enforcement. “As the thorough analysis in our annual report makes clear, the division of enforcement’s performance, effectiveness and activity level during our tenure compares favorably with any period in the commission’s history.”

Avakian and Peikin also highlighted their efforts to root out wrongdoing in virtual currencies, saying the agency had “emerged as a global leader in addressing misconduct relating to digital assets.”

In earlier speeches, Avakian and Peikin have said that the agency should be judged not by financial penalties alone, but by the overall impact of its cases. They have pointed to a recent action against Elon Musk, the Tesla co-founder accused of misleading investors with Twitter posts about taking the company private.

The SEC has chalked up some of the decline in settlement sizes to recent Supreme Court rulings that effectively handcuffed the agency. The agency has also noted that it filed a flurry of cases toward the end of the government’s fiscal year on Sept. 30 even while losing 10 percent of its workers over the past two years.

Legal experts who track the SEC and Justice Department attributed some of the decline in penalties to factors beyond the federal government’s control, noting that a soaring stock market had left the agencies with a smaller pipeline of cases because evidence of malfeasance is often easier to identify in tougher economic times. The Obama administration owed its surge in penalties partly to the fallout of the financial crisis, the experts said, whereas Wall Street has since bolstered some compliance procedures.

The Justice Department has said that the number of defendants prosecuted for white-collar crime has generally decreased since the second half of the Obama administration. In fiscal year 2018, the number rose slightly from the prior year but was still the second-lowest since 2004, and it includes many small-bore cases against individuals.

The decline in corporate penalties from the Justice Department may partly reflect the Trump administration’s heavier emphasis on immigration, violent crime and drugs. For two years in a row, the department has announced record-breaking prosecutions of health care fraud, much of which is related to the opioid crisis.

“Attorney General Sessions has set clear goals for this department: reducing violent crime, homicides, opioid prescriptions and drug overdose deaths,” said Steven Stafford, a department spokesman. “Under his leadership, we have begun to achieve all four of these goals by increasing violent crime and firearm prosecutions to all-time highs.”

He added, “There can be no doubt that this is a pro-law enforcement administration and Department of Justice.”

From Snake Oil to Stock Fraud

When Jay Clayton, Trump’s choice for chairman of the SEC, took the oath of office in May last year, he was surrounded by his family, his staff and the Supreme Court justice he had selected to swear him in: Anthony M. Kennedy.

The presence of Kennedy, a moderate conservative, indicated that Clayton, a political independent, was not plotting a radical partisan revamping of the agency.

But Clayton’s remarks that day about job creation — something not directly under the purview of the commission — signaled a new emphasis on bolstering the economy rather than policing Wall Street.

“The work of the SEC is fundamental to growing the economy, creating jobs and providing investors and entrepreneurs with a share of the American dream,” he said in a statement that referred to keeping markets safe but made no mention of the agency’s enforcement role.

Weeks later, at a meeting with SEC employees, Clayton professed a willingness to scale back corporate penalties and announced a stepped-up focus on protecting “retail” investors, which has directed more of the agency’s attention toward small fraudsters rather than big corporate players, according to a person who attended. The agency later abandoned some punitive Obama-era practices, such as requiring defendants in the most egregious cases to admit wrongdoing.

“I think Clayton has a different focus,” said J.Bradley Bennett, a partner at Baker Botts who is a Republican and a former head of enforcement at the Financial Industry Regulatory Authority, a nongovernmental brokerage regulator. “His success metric is not enforcement fines or cases; it’s the number of IPOs.”

As part of the analysis of SEC enforcement, The Times, in consultation with legal experts, identified every case the SEC filed between mid-May 2015 and September this year, reflecting back-to-back 20 month periods in the Obama and Trump presidencies. The analysis spanned 2,158 cases and was intended to measure the real-time impact of the change in administrations in January 2017.

In addition to charting a sharp drop in financial penalties of $3.1 billion across all cases, the analysis shows that the SEC charged far fewer high-profile defendants under Trump, including less than half as many banks and 40 percent fewer public companies. (Many of the bank cases under Obama stemmed from a voluntary self-reporting program aimed at penalizing misconduct in municipal bond offerings.)

In May, the Securities Enforcement Empirical Database at New York University and Cornerstone Research, which helped The Times identify public companies among the defendants, reported a lag in cases against public companies. The data showed an uptick as the SEC’s enforcement unit shifted into higher gear over the summer, and the SEC during the Trump era has penalized such prominent companies as Citigroup and Walgreens.

But even with that surge, many of the SEC’s cases underscored its focus on smaller defendants who defraud individual investors, according to experts who track the agency’s doings.

For example, actions soared in the 2018 fiscal year against fraudulent stock offerings and investment advisers accused of lying and stealing, said Gerald Hodgkins, a former senior SEC enforcement official who left the agency last December and is now a partner at Covington & Burling. One recent case targeted a Florida man who was purporting to sell snake oil — pain relief drugs using cobra venom, to be precise — but whose company, it turned out, had no snakes. At the same time, the SEC brought fewer market manipulation cases, which are generally seen as more sophisticated, said Hodgkins, who conducted an analysis of case data. The number of accounting fraud cases, which often have many victims, declined as well.

“We are definitely seeing a shift from the more complex cases to those that are less time-intensive and affect a narrower segment of the investing public,” Hodgkins said, adding that he thought the agency overall had a productive year.

The SEC has defended its willingness to go after high-profile perpetrators with punishments beyond financial penalties. It cited a settlement with Elizabeth Holmes, the founder of Theranos, who agreed to forfeit a majority voting control over the company, and the case against Musk, whom the agency ousted as chairman of Tesla. The agency has also pointed to its hiring of a former federal prosecutor known for aggressively pursuing white-collar cases to run its New York office.

When the SEC publicizes enforcement figures, it includes penalties that other government agencies have collected in related actions and calculates them based on when the cases were resolved, not when they were filed. This method, which predates Trump, credits the SEC under his administration with bringing in $1.7 billion that Petrobras, a Brazilian company, was ordered to pay to other government agencies and plaintiffs in a private lawsuit.

Tabulating penalties this way still leads to a $938 million gap between the two administrations, according to Urska Velikonja, a professor at Georgetown University Law Center who studies the SEC. (The Times analysis, which found a $3.1 billion gap, excluded payments to outside agencies and attributed penalties to each administration based on when a case was initiated, not settled.)

The SEC disagreed with The Times’ analysis, saying that it failed to account for the natural ebb in enforcement activity at the start of an administration and that the early months of the Trump era saw more cases filed than did the beginning of the Obama era. The agency also took issue with The Times’ decision to focus on penalties, a spokeswoman said, because “the dollar amount of the penalties on their own don’t say anything about whether we’re protecting investors or enhancing market integrity.” Some of the decline in penalties may reflect the growing skepticism over corporate penalties, particularly among the agency’s Republican commissioners. Clayton, who during his confirmation hearing said he was “100 percent committed to rooting out any fraud,” is often caught in the middle between the agency’s Republican and Democratic commissioners.

The Times also found some investigations begun under Andrew J. Ceresney, the enforcement director in the final years of Obama’s presidency, that hit a brick wall under Trump.

In an investigation involving Morgan Stanley and Barclays, the banks had helped assemble the prospectus for a 2014 Puerto Rican bond deal. Although Puerto Rico’s dire financial health was well known to investors, the SEC under Obama investigated whether the document accurately warned that the territory was on the brink of bankruptcy.

The investigation continued into the early months of the Trump presidency, when SEC investigators told the bank they planned to bring charges. After higher-ranking SEC enforcement officials reviewed the evidence, the agency dropped the investigation, people briefed on the matter said.

Morgan Stanley and Barclays declined to comment. Legal experts said that the agency had occasionally reversed itself and ended investigations during the Obama era, as well.

Separately, an investigation into whether Carlyle, the private equity firm, misled investors about certain fees sputtered. The SEC filed and settled similar cases against Carlyle’s main competitors during both administrations, but the Trump administration did not do the same against Carlyle, people briefed on the matter said. Carlyle declined to comment.

A Supreme Court ruling last year, Kokesh v. SEC, may have influenced the agency’s approach to the investigation. The ruling held that the SEC has only five years to collect ill-gotten profits; private equity firms like Carlyle typically have investment funds with a life span of 10 years or more.

The SEC has also said that a separate legal challenge to the constitutionality of its administrative court, where it typically filed many of its cases, reduced enforcement. A Supreme Court ruling this year forced the agency to reboot its administrative court process.

‘No Reason to Fear Prosecution’

As the presidential campaign was drawing to a close in late 2016, lawyers for Walmart met with senior Justice Department officials in Washington to discuss a possible settlement.

The department had spent four years investigating whether the retail giant had bribed government officials in Mexico and other countries, one of the biggest investigations ever under the Foreign Corrupt Practices Act. The department wanted Walmart to pay penalties of about $600 million, according to people with knowledge of the meeting. A guilty plea was on the table for the company or one of its subsidiaries, and the SEC was pushing for a steep punishment, as well.

Walmart bristled, and as the election came and went, the two sides continued to negotiate, leading Walmart to receive more favorable terms from the Justice Department. But at the tail end of the Obama administration, it became increasingly difficult to get Walmart’s lawyers to schedule meetings, according to two people with knowledge of the negotiations, who spoke about the private discussions on the condition of anonymity.

Walmart had reason to hope that the Trump administration might have a more open mind.After the Walmart bribery scandal first came to light in an investigation published in The Times in 2012, Trump, then a real estate mogul with international holdings, said on CNBC that it was unfair to expect a company like Walmart not to engage in bribery when doing business overseas. The Foreign Corrupt Practices Act, he said, was a “horrible law, and it should be changed.”

A person briefed on the matter said negotiations gained steam in the early months of the Trump administration. Although Walmart was negotiating with the same career officials as it had during the Obama administration, the company closed in on a more favorable deal. Negotiations stalled again, and to date, the case against Walmart has not been resolved, though an announcement could come soon, the person briefed said. The company has said publicly that it set aside $283 million to cover potential settlements.

A Walmart spokesman said the company was “continuing discussions with the government agencies as we work to reach a solution.” Stafford, the Justice Department spokesman, objected to The Times’ account of the negotiations, without specifying what the department disputed.

As part of the analyses of enforcement activity under Trump, The Times asked Duke Law School and the Legal Data Lab at the University of Virginia School of Law to analyze corporate criminal prosecutions at the Justice Department, which they track.

Brandon L. Garrett, the Duke law professor who examined the data, identified a drop in the number of penalties under Trump when compared with the final 20 months of the Obama administration (a 72 percent decline) and when compared with the first 20 months of the Obama presidency in 2009-10 (a 23 percent decline).

Garrett said he routinely spoke to corporate compliance officers who lamented how the drop had undercut efforts inside companies to allocate more resources to preventing misconduct.

“There’s no reason to fear prosecution for committing serious corporate crimes,” he said.

In March, Deputy Attorney General Rod Rosenstein declared that the Justice Department wanted to “avoid imposing penalties that disproportionately punish innocent employees, shareholders, customers and other stakeholders.” He has also promised that the department would try to prevent multiple law enforcement agencies from “piling on” corporate fines. That approach was reflected in a number of recent cases against prominent defendants, including Société Générale, in which the Justice Department gave the companies credit for penalties paid to other authorities.

Some current and former employees attributed the deceleration in corporate cases, at least in part, to a leadership vacuum in the department’s criminal division. Until July, the division had no Senate-confirmed leader.

“If you don’t have stability and organization at the Department of Justice, you may not have the bandwidth to handle major corporate prosecutions,” Garrett said.

The decline in criminal penalties has unfolded against a backdrop of broader regulatory rollbacks in the civil arena.

Under the Obama administration, the Justice Department’s civil rights division poured resources into lending-discrimination cases, some involving the nation’s biggest banks. In the last full year of the Obama administration, the department filed seven lawsuits alleging lending violations. The next year, the Trump administration filed one such lawsuit.

And like Walmart on the criminal side, some targets of civil prosecutions welcomed the more business-friendly approach of the Trump administration.

Barclays, under investigation by the Obama administration for selling the soured mortgage investments, had rejected the Justice Department’s demands to pay almost $7 billion, according to people with knowledge of the negotiations. The Obama administration had, in turn, filed a lawsuit against the company using the Financial Institutions Reform, Recovery and Enforcement Act, a law that Republicans in Congress had tried to curtail.

In March, Barclays settled for a much reduced penalty of $2 billion, which the bank argued was in line with what other financial institutions had paid for similar conduct.

RBS, similarly suspected of defrauding investors in mortgage-backed securities, was facing a criminal investigation from federal prosecutors in Boston, who had obtained records of bank employees discussing “garbage” loans and “rampant” fraud.

Toward the end of the Obama administration, Boston prosecutors declined to take a potential criminal prosecution off the table, according to people familiar with the matter. But under the Trump administration, Rosenstein decided that the case should not involve criminal charges in part because it was unfair to single out one of the many banks caught up in the mortgage investigations, two of the people said. Ultimately, RBS reached a $4.9 billion civil settlement. The bank declined to comment.

The Barclays and RBS outcomes reflected the broader trend in cases brought against financial firms under the Financial Institutions Reform, Recovery and Enforcement law and the False Claims Act, which targets fraud of government programs.

The Justice Department obtained $7.4 billion in such cases filed in the first 20 months of the Trump administration — about 28 percent of the amount collected in the final 20 months of the Obama administration, according to an analysis of public disclosures by the agency compiled by Buckley Sandler, a law firm. (In October, the agency filed two large cases that would bring the Trump administration’s total to $8.6 billion.)The decline, in part, stems from a new policy Sessions issued last year requiring settlement money to go to victims or the Treasury Department, a change that effectively prevented prosecutors from forcing banks to spend billions of dollars addressing neighborhood blight and other issues tied to the mortgage crisis.

Andrew Schilling, a partner with the firm who previously led the civil division at the U.S. attorney’s office in Manhattan, said there had also been a marked decline in new financial fraud investigations being opened.

“Certainly, 10 years out of the financial crisis you’re not going see quite the same activity,” he said, “but I never thought I would see financial fraud enforcement fall off as sharply as it has.”