University of California, Davis Chancellor Linda Katehi. (Rich Pedroncelli/AP)

The chancellor of the University of California, Davis has resigned after an investigation, ending years of upheaval and criticism of her leadership at the public university.

Chancellor Linda P.B. Katehi, an electrical and computer engineering scholar, said Tuesday that an investigation launched this spring had cleared her of accusations of nepotism, retaliation, and inappropriate travel expenses. She said she now plans to return to teaching.

But University of California President Janet Napolitano said in a statement that the investigation, which she initiated after Katehi declined to resign this spring, “found numerous instances where Chancellor Katehi was not candid, either with me, the press or the public, that she exercised poor judgment and violated multiple university policies.

” … These past three months and the events leading up to them have been an unhappy chapter in the life of UC Davis. I believe it is in the best interest of the campus, the Davis community and the University of California that we move forward.”

In 2011, a campus police officer pepper-sprayed a line of student protesters who were sitting passively on the ground. A video of the incident went viral, provoking horror among many who saw it as a frightening and excessive use of force and an attack on the freedom of speech.

UC Davis police pepper-spray protesters. (AP)

Protests escalated on the campus of about 35,000 students, with national media attention on students demanding an end to tuition hikes and a return to the ideal of affordable public higher education in California.

The backlash against the university’s treatment of peaceful protesters continued, and in 2013, according to documents obtained by the Sacramento Bee this spring, the university contracted with consultants at least $175,000 to try to remove “venomous” references on the Internet and try to improve the reputation of both the school and its chancellor online.

According to the Bee, the school’s strategic communications budget rose from just under $3 million in 2009, when Katehi became chancellor, to nearly $5.5 million in 2015.

Shortly after the Bee’s story in April, Katehi was placed on administrative leave. Napolitano said there was a broader investigation — not just over the attempts to scrub references to pepper spray from online search results — including allegations that family members working for the university got special treatment and excessive raises.

On Tuesday, Napolitano accepted Katehi’s offer to resign as chancellor. Melinda Guzman, Katehi’s lawyer, speaking at a news conference, objected to Katehi’s treatment by Napolitano, including her treatment of confidential personnel issues, saying the announcement of the administrative leave violated rules of academic integrity.

Ralph Hexter, who has been acting chancellor since late April, said in a statement, “Today’s news ends a period of uncertainty at UC Davis. The resolution announced by President Napolitano permits us to focus all our efforts on moving the campus forward so that we can serve California, the nation and the world ever more effectively.”

Hexter will continue as acting chancellor while a national search is underway for the next chancellor.

Some students were relieved. “It did the UC Davis community no good for her to continue to hold onto her office at the expense of our community,” Alex Lee, president of the Associated Students of the University of California, Davis, wrote in an email to the Associated Press. “I think it frustrated students that she held on, especially with paid leave.”

Katehi, who has been an advocate of bringing more women into science fields, will be a full-time faculty member, with tenure, in the electrical and computer engineering department and the interdisciplinary program on gender, sexuality and women’s studies.