Boston Public Schools Superintendent Tommy Chang announced his resignation on Friday, two years before his contract with the school system was set to expire.

Chang took over BPS in 2015, coming here from the Los Angeles public school system and signing on to a five-year contract in Boston.

In a letter to the BPS community sent on Friday, Chang said that he is “grateful to the people of Boston for the opportunity to serve here — and for what that opportunity means about what’s possible in America.”

Chang laid out achievements within the school system made over the last three years, including the fact that the BPS graduation rate has increased from 70.7 percent to 72.7 percent, but Chang’s time at the helm of the 56,000-student school system has had a few setbacks, as well.

The proposal to change school start times sparked widespread backlash, forcing the district to cancel the proposed changes, and a 2017 audit found that BPS used student activity accounts to pay employees under the table without reporting the income to the Internal Revenue Service.

BPS was also sued last week, the Boston Globe reported, by civil rights and student advocacy groups over the school system's failure to disclose whether or not it was handing over student information to Immigration and Customs Enforcement officials. On Monday, Chang responded to this in a letter to the school community.

"I’m taking the unusual step of speaking on a lawsuit we have not officially received yet because I want you to know how strongly we, as an organization, and I personally, as an educator and an immigrant, feel about protecting immigrant children," Chang wrote. "The allegation that has been made in news reports is that the Boston Public Schools (BPS) shared information with federal Immigration and Customs Enforcement (ICE) that led to the arrest of a student. That claim is false. BPS would never give student information to ICE, unless required under law."

Mayor Marty Walsh commented on Chang's announced resignation in a statement, saying the decision was mutual.

"Over the past year, I have spent a lot of time thinking about the progress we have made to improve education in Boston and the significant work ahead to ensure that we successfully reach the ambitious goals we have set for our students and schools,” Walsh said. “After several conversations with Tommy Chang about the future of Boston Public Schools, we have mutually agreed that there needs to be a change in leadership at BPS.”

Official reasons for Chang’s resignation were not disclosed. City officials said that Walsh does not blame Chang for those recent BPS controversies, the Globe reported. Still, Walsh hinted at frustrations in his statement, saying that BPS needs “a long-term education leader with a proven record in management who can gain the confidence of the community on the strategic vision for the district.”

An interim BPS superintendent is expected to be named sometime this week.