Brooklyn District Attorney Kenneth Thompson, who announced on Tuesday he was taking leave to deal with a cancer diagnosis, has died, according to a statement released Sunday by his office.

The statement said Thompson died Sunday of cancer at Memorial Sloan Kettering Cancer Center in Manhattan with his family by his side. The statement did not specify the type of cancer Thomson had or who will replace him on an interim basis until the 2017 election.

Thompson, 50, was sworn in as the borough’s first African-American district attorney in 2014. Thompson won the seat in 2013 after besting longtime incumbent Charles J. Hynes in a bitterly contested Democratic primary.

His Tuesday announcement that he would be taking a leave of absence stunned many in the criminal justice establishment.

In his statement, Thompson said that while he sought treatment, the office would be run by his chief assistant Eric Gonzalez.

Law enforcement sources said Tuesday that Thompson had been periodically out of the office in recent months.

advertisement | advertise on newsday

One of his last major news conferences was June 29, when he announced charges in the 2015 murder of an aide to Gov. Andrew M. Cuomo during a J’Ouvert celebration.

Through a spokesman, Hynes said he was praying for Thompson’s family and wished the best for his wife and two children.

Cuomo said in a statement that Thompson “was a dedicated public servant who embodied the highest principles of the law, and his grand presence will be sorely missed.”

The governor ordered flags at half staff Monday in tribute to Thomson.

Rep. Kathleen Rice (D-Garden City), formerly the Nassau County district attorney, tweeted her condolences Sunday night, writing that she “was shocked & saddened by the death of Brooklyn DA Ken Thompson. A man of integrity who had the courage to reform the system. He will be missed.”

NYC Mayor Bill de Blasio said in a statement that “our courtrooms and our communities have no doubt been dealt a blow with Ken’s passing, but I am confident the indelible mark left by his public service will forever be a part of the fabric of our justice system. Tonight we mourn the loss of a champion of reform. Our task now will be to rise each day forward in the spirit Ken lived his life.”

NYPD Commissioner James O’Neill also released a statement Sunday saying Thompson “dedicated his life to the pursuit of justice and his legacy will live on through his contributions to the criminal justice system. ‎Our deepest condolences and prayers are with his family and loved ones at this time.”

Thompson was born and raised in New York City. His mother, Clara Thompson, was one of the first female police officers in the NYPD to patrol the streets in 1973, and went on to serve as a member of the NYPD for 21 years, according to the statement released by his office

advertisement | advertise on newsday

A graduate of New York City public schools, Thompson went on to graduate magna cum laude from John Jay College of Criminal Justice, the statement said.

Thompson previously served as a federal prosecutor in the Eastern District of New York. He worked on the team that successfully prosecuted former NYPD Officer Justin Volpe in 1997 beating of Haitian immigrant Abner Louima.

He also served as a special assistant to the U.S. Treasury Department Undersecretary for Enforcement in Washington, D.C., and in the General Counsel’s Office at the Treasury. He was part of the team of lawyers and federal agents that investigated the 1993 raid on David Koresh and the Branch Davidian Compound in Waco, Texas.

He is survived by his wife of 17 years, Lu-Shawn Thompson, his two children, Kennedy and Kenny, his mother, father, brother and sister.

With Anthony DeStefano