She told the mayor that her decision was final in the past weeks. The administration had been conducting a "nationwide search" for her successor.
Farina, now 74, was appointed four years ago to oversee the city's 1,800 schools and 1.1 million students.
Mayor de Blasio described her as an extraordinary talent, wise and someone who made teachers, parents and students feel that they were in good hands.
Farina reversed many of the policies under the Bloomberg administration such as giving schools annual grades while trying to foster an atmosphere of collaboration instead of competition.
She was not without critics, some of whom said she lacked vision for reform.
"I never joined in this job to be loved or to win a popularity contest," she said on Thursday. "I came into this job to be respected and to be understood so that people would then be motivated to do what I think is important for the children of New York."
In a letter to her staff (full copy below), Farina wrote she "took the job with a firm belief in excellence for every student, in the dignity and joyfulness of the teaching profession, and in the importance of trusting relationships where collaboration is the driving force."
"She will go down in history not only as one of the longest-serving chancellors in the history of New York City but as one of the most effective chancellors we ever had," Mayor de Blasio said.
Mayor de Blasio kicked off a noon news conference by also announcing Police Commissioner O'Neill and FDNY Commissioner Nigro will be sticking around for his second term.
New York City is on track to smash its modern-era low for homicides in a year.
Through Dec. 17, the city of 8.5 million people, once America's murder capital, had recorded 278 killings. That puts it on pace to end this year with killings down 14 percent from last year, and well below the 333 in 2014, which was the year with the fewest homicides since the city began keeping accurate crime statistics in 1963.
Those numbers mean a person's odds of getting killed by homicide in tightly packed, diverse New York City this year were about the same as they were last year in Wyoming, Montana and South Dakota.
Crime has been dropping for many years in New York, but 2017 saw substantial drops even in places like Brooklyn's 75th Police Precinct, once among the nation's most violent places.
WATCH FULL NEWS CONFERENCE:
Carmen Fariña's letter to staff
Four years ago, Mayor de Blasio asked me to unretire at age 70 to join his leadership team and become Schools Chancellor.
At every step in my professional and personal life, when asked to take on a new challenge, I've always referred back to the poem "To Be of Use." The poem begins, "The people I love the best jump into work head first." For those of us who have a deep commitment to our work - and this is particularly the case for educators - saying no is almost impossible. When faced with a need and work that is meaningful, no matter the difficulty or the sacrifice, we say yes. Together, we produce transformative results.
And so, with great excitement and enthusiasm, I said yes to Mayor de Blasio. I did so because of my faith in the promise of public education to level the playing field, transform lives, and give every child opportunities regardless of their zip code. I took the job with a firm belief in excellence for every student, in the dignity and joyfulness of the teaching profession, and in the importance of trusting relationships where collaboration is the driving force. These are the beliefs that I have built over five decades as a New York City educator, and they have been at the heart of the work we have done together for the past four years.
Today, I want to share with you my plans to retire (again) in the coming months. As I begin to prepare to step down as Chancellor, I want to reflect on our accomplishments and thank you - the incredible New York City educators who have made the work more engaging, meaningful, and joyful. I think of each of you with gratitude as I read this line in "To Be Of Use:" "I want to be with people who submerge in the task." Submerging in the task with you has been an enormous gift.
First and foremost, to our 1.1 million schoolchildren, who deserve hope in your lives, success in and out of the classroom, and a meaningful future. You are the reason we strive every day to be of use.
To our superintendents and your teams, who rise to the occasion to support principals and cultivate success. You never hesitate when called upon, and your leadership provides direction for our shared work.
To our principals and your teams, who understand that a good night's sleep only comes when there is a strong teacher in every classroom and that collaboration brings about positive results. Your days are long, your sacrifice immense, and your reward indescribable.
To our teachers, who know that public education changes lives. You work tirelessly for every student and family, and infuse the excitement of learning in every classroom and school.
To our families, who are our children's first teachers. Only by continuing to work together can we help ensure our children reach their full potential. I have total admiration for the sacrifices you make - as newly arrived immigrants, single parents, families juggling multiple jobs, or even adults trying to communicate with students at the most difficult age group, teenagers. With your partnership, we have redoubled our family engagement - and listening to your concerns is what constantly makes us better.
To our custodians and facilities experts, who make each building welcoming, joyful and safe. Your commitment is deeply valued, and your dedication makes a difference for our students, our staff, and our families.
To the administrative support teams, who make the impossible seem easy. Your work to make every school day smooth and ensure every question is answered and every need met sets an example of service for us all.
To the school safety agents and school monitors, who know that relationships are at the core of what we do for our children. You set the tone for each student, parent, and guest who visits our schools.
To the co-located campuses, and everyone in our school system working to break down silos. You are proving that collaboration works better than competition, and that by working together we can achieve more than any one of us could accomplish alone.
To our teams across the DOE, who work every day to make a difference. Sometimes you impact thousands of lives, sometimes hundreds, and some days, just one. But each day, you make a difference in the life of a child, and in that, you are changing the course of history.
Thank you all for the hard work you've done, and that you'll continue to do. You jump into work, you submerge in the task.
It has been the greatest honor to serve as your Chancellor and I look forward to our shared work ahead.
* More New York City news
* Send us a news tip
* Download the abc7NY app for breaking news alerts