Valeria Silva will no longer be the superintendent of St. Paul Public Schools effective July 15, according to a district source close to settlement negotiations.

Silva is agreeing to leave the district's top job two years before her contract was set to expire. Her six-year tenure leading the state's second-largest school district was marked by gains in graduation rates and policies aimed at improving outcomes for minority students, but her time was recently marred by declining enrollment and questions of school safety.

In the end, Silva appeared to have lost the confidence of both teachers and a school board with many new members who swept into office last year on the promise to address issues with the district's leadership.

According to the district source, Silva is entitled to receive her $213,026 salary, plus $11,000 per year in longevity pay, from now through December 2018. She will also stay on with the district for 15 months in an advisory role to help an interim superintendent with the transition.

Minor details of her departure were still being discussed Friday, the district source said. The school board is expected to approve the agreement Tuesday.

St. Paul school board Chairman Jon Schumacher declined to comment. The school district issued a statement saying that "amicable negotiations" were ongoing.

On Friday, Silva, who took over the district in December 2009, spoke to about 130 school district leaders during her annual administrator's meeting.

She did not specifically address her departure. But her remarks, which reflected on the year, had a note of finality to them.

"At this point in the year, we tend to forget the many good moments we had with our teams, students and families," she said. "Try to reflect on those memories soon, they will fill your soul and give you a sense of personal accomplishment — a feeling that we all need."

Silva went on to thank those who have worked for years in the school district, and she reflected on her beginnings in Minnesota — three months to learn English at St. Cloud State University that turned into nearly 32 years in the state — and what she has learned in her time since coming from her native Chile.

She also talked about perseverance. "There were many times especially while being a superintendent that I thought I couldn't do it anymore. But some of you provided me with that confidence and encouragement that I needed to continue our work," she said, adding: "Thanks for believing in me as a leader. Yes, nobody is perfect and I know during my time as a leader of this organization we made big changes. Not all of them were implemented as well as we wanted. But you and your staff were able to adjust and make it happen."

She noted some of her accomplishments, such as higher graduation rates in the district compared with the state average and providing iPads to every student through a $39 million referendum.

But the 2015-16 school year has been particularly tumultuous as enrollment has declined and the district faces a multimillion-dollar deficit.

Her leadership also was marred by repeated instances of student-on-staff violence and other school climate and safety concerns — issues that the district's teachers union considered serious enough to strike over.

A walkout was averted when the district and union reached a deal in February to allow schools to pilot new ways to tackle school-discipline problems. But two months later, district parents presented a petition to board members seeking Silva's ouster, citing not only the discipline concerns, but enrollment losses to charter schools and alleged attempts to stifle teachers who were critical of her policies.

Nancy Bitenc, a parent who was part of the petition, said she was glad the board was responding.

"It turns out that in the background, they have been working on the same goal the whole time," Bitenc said.

During Silva's tenure, graduation rates have increased from 61 percent of students graduating on time in 2009 to 75 percent in 2015.

While there are still gaps between students of color and white students, Hispanic and black students are graduating at higher rates than in 2009. Graduation rates among Hispanic students rose to 72 percent in 2015 from 46 percent in 2009.

However, test scores have declined slightly since 2011, when a new test was introduced. In 2011, 40 percent of St. Paul's students met the state's math standards (proficient). In 2015, 37 percent were proficient. Reading scores in 2015 were lower than the previous year.

State Rep. Carlos Mariani, DFL-St. Paul, a strong supporter of Silva, said he believes her focus on equity and closing the achievement gap has caused people to feel uncomfortable. "My suspicion here is that that's the type of tension that is basically driving her out. In the end, it's our system, and it's our kids that end up getting hurt," he said Friday.

An interim superintendent is expected to be named Tuesday after the board approves the agreement with Silva. According to the district source, the board openly discussed potential interim leaders at a public board retreat, but no one from the public attended the meeting.

If Silva finds employment after her role as an adviser to the school district, she will no longer be entitled to receive her salary but will be able to retain her retirement benefits in 2018.

Mariani said he will not let the next leader of the school district and the board lose focus on improving academic outcomes for students of color.

"My biggest fear is that the response will be to back off from the door she has opened," said Mariani, who has grandchildren in the district. "But I am going to keep pushing for a strong equity focus."

Bitenc, not a supporter of Silva, said she wants a superintendent who will be a "community builder."

"The board needs to step forward from the fake potted plants and sit down with parents and listen to their needs," Bitenc said.

Staff writer James Walsh contributed to this report.