After spending four years working to enact President Trump’s agenda of lifting government rules on industry, Transportation Secretary Elaine Chao announced her resignation Thursday, saying she was left “deeply troubled” following the assault on the Capitol by a mob acting on her boss’s behalf.

Chao, sworn in during Trump’s second week in office, was the first member of the Cabinet to quit in the wake of Wednesday’s violence. Education Secretary Betsy DeVos became the second when she announced her resignation late Thursday.

“Yesterday, our country experienced a traumatic and entirely avoidable event as supporters of the President stormed the Capitol building following a rally he addressed,” Chao wrote in an email to staff members at 1:32 p.m. Thursday. “As I’m sure is the case with many of you, it has deeply troubled me in a way that I simply cannot set aside.”

Chao’s resignation takes effect Monday, and the department’s general counsel, Steven Bradbury, is in line to serve as acting secretary for the final days of the president’s term. Other top officials in the department are expected to remain in their positions.

Chao's position in the administration was a complicated one: She is married to Senate Majority Leader Mitch McConnell (R-Ky.), who broke with Trump over his baseless claims that the election had been rigged. McConnell also had drawn the president's ire in other occasional clashes.

“I stand by my man — both of them,” Chao said during one dispute between the two.

That relationship left Chao under scrutiny by her department’s internal watchdog following allegations she had used the power of her office to benefit her husband’s constituents. The findings of the Office of Inspector General have yet to be publicly released, and two people familiar with the process said they could be soon.

Chao came to the department with greater government experience than many of Trump’s appointees, having served as labor secretary under President George W. Bush — becoming the first Asian American woman to hold a Cabinet job. She pointed to a focus on safety, the department’s gravest responsibility, while freeing private industry from rules that conservatives argued had needlessly proliferated during the Obama era.

The department’s single largest achievement during Trump’s tenure was its contested move to weaken greenhouse gas emissions standards for cars and SUVs, but it also held back from imposing rules on self-driving cars and made it easier for companies to experiment with airborne drones.

In an interview with The Washington Post in late May, Chao described coming into office facing an “incredible overhang of government regulation.”

“The transportation sector was burdened,” Chao said. “What we have done is to selectively look at regulations that are overly intrusive and burdensome.”

That approach won the support of industry organizations but led to conflicts with consumer and safety organizations, as well as Democrats in Congress, who decried the rollbacks and said some jeopardized safety.

Rep. Sam Graves (Mo.) the top Republican on the House Transportation Committee, thanked Chao on Thursday for her work over the past four years.

“I also want to thank her for her constant professionalism and her friendship,” Graves said in a statement. “She has been a champion of infrastructure and transportation safety.”

Despite her relatively conventional profile, Chao was not able to completely avoid the chaos that has marked Trump’s time in office.

In August 2017, she stood beside the president in the lobby of Trump Tower, visiting New York ostensibly to discuss infrastructure. Trump said she was doing a “fabulous job.”

Yet those remarks became infamous when Trump veered off topic to discuss far-right violence that had engulfed Charlottesville days before, saying a group of white-supremacist demonstrators included “very fine people” and that blame for the violence lay with “both sides.”

Some critics questioned Chao’s late change of heart toward the president.

Rep. Gerald E. Connolly (D-Va.), who leads a House oversight subcommittee, said Trump’s list of offenses is “almost infinite,” citing conflicts of interest, his pressuring of Ukrainian President Volodymyr Zelensky and his mismanagement of the coronavirus pandemic.

“I find it mystifying, if not ironic, that prominent Republicans suddenly find that this president could behave in a way that is dangerous to democracy,” Connolly said. “Elaine Chao decides she’s had it, nine days before the swearing-in of a Democratic successor? That’s quite an act of principle and courage. Where have you been?

On infrastructure, where her experience was touted early on as a plus, Chao and the administration were unable to secure Republican congressional support for a package of at least a trillion dollars for roads, bridges and airports. Instead, “infrastructure week” became a punchline.

A fresh proposal Chao said the department was working on over the summer never materialized. Nonetheless, Chao and her team had much they were proud of.

She spent recent months grappling with the fallout that the pandemic inflicted on the nation’s transportation network. The department relied on its preferred light-touch approach: It temporarily lifted rules such as those limiting how long truck drivers can spend behind the wheel to ensure essential goods could keep moving and declined to mandate the wearing of masks on planes, buses and trains.

In the May interview, Chao said her team’s efforts in the pandemic’s early days were “heroic.”

“We’ve been successful in helping the transportation system remain operational and safe so the rest of us can stay at home during the intense period of shelter in place,” she said.

Around the same time, Chao’s relationship with McConnell faced fresh scrutiny when Trump replaced the Transportation Department’s acting inspector general as part of a broader campaign against the internal government watchdogs. Democrats charged the move was designed to protect Chao from an investigation into her dealings with Kentucky.