Education Secretary Betsy DeVos, one of President Trump’s longest-serving and most loyal Cabinet members and also one of his most controversial, submitted her resignation Thursday, citing the president’s role in the riot on Capitol Hill.

“There is no mistaking the impact your rhetoric had on the situation, and it is the inflection point for me,” she wrote in a letter to President Trump. The behavior of the “violent protestors overrunning the U.S. Capitol” was “unconscionable,” she wrote.

“Impressionable children are watching all of this, and they are learning from us. I believe we each have a moral obligation to exercise good judgment and model the behavior we hope they would emulate,” she wrote. “They must know from us that America is greater than what transpired yesterday.”

She said her resignation is effective Friday. The resignation, she said, was “in support of the oath I took to our Constitution, our people, and our freedoms.”

DeVos has rarely said anything that could be read as a criticism of Trump. In recent days, though, even as Trump disputed the election results, DeVos publicly acknowledged that President-elect Joe Biden had defeated him.

She joined several other Trump administration officials who quit with less than two weeks left in his term, in protest of the violence Wednesday.

Earlier in the day, Elaine Chao — who is married to Senate Majority Leader Mitch McConnell (R-Ky.) — resigned as transportation secretary, saying she was “deeply troubled” by what had happened at the Capitol. In addition, Mick Mulvaney quit his job as the U.S. special envoy for Northern Ireland.

On Friday morning, DeVos emailed a farewell note to the staff at the Education Department, who had no advance word of her resignation. “It has been a privilege to serve America’s students alongside you,” she wrote.

DeVos served as secretary for almost the entire Trump term, holding on to her job even as a string of other senior officials left or were pushed out. She was fiercely loyal. Last year, for instance, she spent three days defending proposed funding cuts to the Special Olympics that the White House had insisted on, and then watched as Trump announced that he was restoring the funding.

“Can someone pull Betsy from under the bus?” asked Rep. Mark Pocan (D-Wis.).

Throughout her tenure, DeVos was fiercely opposed, and even hated, by many Democrats, who said she was unfit for the position in the first place and cared more about supporting private schools than public education. Her difficulty answering questions under pressure, starting with her Senate confirmation hearing, cemented her place for many as unqualified. Vice President Mike Pence had to break a tie vote in the Senate in order to confirm her.

Years later, DeVos remained a rallying point on the left, with Democrats invoking her name as they campaigned for office. She also was the subject of threats, and required protection from U.S. marshals, a first for an education secretary.

Opponents gave her little if any credit for taking a stand with her resignation.

“Good riddance,” was the two-word statement issued by Randi Weingarten, president of the American Federation of Teachers.

“Regardless of her actions in the waning days of this disastrous presidency, Betsy DeVos will go down as one of the worst Secretaries of Education in history,” said Kelly Gonez, board president of the Los Angeles Unified School District.

Some DeVos critics questioned the sincerity of her resignation, saying that she should have stayed and supported an effort to oust Trump via procedures laid out in the 25th amendment to the Constitution. “Betsy DeVos has never done her job to help America’s students. It doesn’t surprise me one bit that she’d rather quit than do her job to help invoke the 25th Amendment,” Sen. Elizabeth Warren (D.-Mass.) said on Twitter.

But Jeanne Allen, chief executive of the Center for Education Reform, a strong supporter of school choice policies, lauded her decision and her tenure.

“Many criticized her, some spew hatred, some will disagree, but many have valued her advocacy for giving parents & kids choices,” Allen wrote on Twitter. “She never disparaged or bullied anyone despite the attacks.”

A billionaire, DeVos had never held public office before being named to the job, although she had worked in Republican politics in Michigan and had worked nationally to promote school choice initiatives, the cause of her life.

She used her tenure to promote school choice, the use of taxpayer dollars to support alternatives to traditional public school such as charter schools and school vouchers. That agenda did not go very far on the federal level, but supporters say her advocacy led to action in several states.

“We have sparked a national conversation about putting students and parents in charge of education, leading to expanded school choice and education freedom in many states,” DeVos wrote in her letter.

She also joined Trump this summer in pushing schools to reopen for in-person classes amid the pandemic. In her letter, she said that history will prove that was the right call.

DeVos also stirred controversy in rolling back many civil rights initiatives from the Obama administration, such as protections for transgender students. A regulation giving more rights to students accused of sexual harassment and assault was lauded by some but attacked by others, and Biden has vowed to unravel it.

DeVos drew the ire of advocacy groups for overturning Obama-era regulations to protect college students from bad actors in the for-profit college industry. She spent the early months of her tenure refusing to process applications for student debt cancellation from defrauded borrowers and implement rules to make it easier for them to secure loan forgiveness.

Her defiance led dozens of state attorneys general to sue DeVos and the department. The cases continued to mount as DeVos proceeded to undo consumer protection regulations.

Danielle Douglas-Gabriel contributed to this report.