Brooklyn District Attorney Ken Thompson said Tuesday that he has been diagnosed with cancer.

Thompson, who took over for longtime DA Charles Hynes in 2014, said in a statement that he will step away from the office as he receives treatment and recovers from the recent diagnosis. It was not immediately clear what type of cancer he was diagnosed with or when.

“As Brooklyn District Attorney, I’ve dedicated myself and our Office’s resources over the past three years to keeping the people of our great borough safe while strengthening our commitment to reform and improve our criminal justice system,” Thompson said in a statement. “And now I am prepared for another fight.”

Thompson said the DA’s office will be run by Chief Assistant Eric Gonzalez and others on the executive team while he receives treatment.

“As a man of intense faith, I intend to fight and win the battle against this disease,” he said. “I humbly seek your sincere prayers as I confront this challenge and respectfully ask that you honor my family’s need and wish for privacy during this time.”

Gov. Andrew Cuomo wished Thompson “a speedy recovery” on Twitter.

Mayor Bill de Blasio said in a statement, “I want to wish my friend and Brooklyn District Attorney Ken Thompson all the best as he temporarily steps aside to take care of what’s most important. I have no doubt District Attorney Thompson will tackle this challenge with the same resolve and determination with which he serves the people of Brooklyn. My administration is prepared to work with Brooklyn’s Chief Assistant District Attorney Eric Gonzalez in District Attorney Thompson’s absence and wishes the District Attorney a speedy recovery and swift return to duty.”

NYPD Commissioner James O’Neill called Thompson a friend and wished him a speedy recovery.

“We were saddened to learn earlier today of Kings County District Attorney Ken Thompson’s diagnosis with cancer,” O’Neill said in a statement. “He is both a colleague and a friend. We offer him our prayers for a speedy recovery. We will continue working with Chief Assistant Eric Gonzales and the rest of his staff in his absence.”

Brooklyn Borough President Eric Adams said in a statement that he’s praying for Thompson “with hope and optimism for the future we will enjoy together.”

“Brooklynites have been privileged to have a fighter like Ken Thompson as the chief law enforcement officer of our borough,” Adams said. “He is a tireless champion for justice, and his work has directly aided our shared mission to make Brooklyn a safer place to raise healthy children and families. I have no doubt that District Attorney Thompson will fight cancer with the same conviction and vigor that he has displayed his entire career.”

The Rev. Al Sharpton, founder of the National Action Network, said in a statement that he was shocked by the news.

“I am stunned at the announcement from DA Thompson that he is battling cancer, and we stand with him as he takes on this fight ... During the DA’s absence we hope the leadership in his office will continue to uphold his steadfast commitment to criminal justice reform. We wish DA Thompson a speedy and complete recovery,” Sharpton said.

The National Action Network will hold a vigil for Thompson at 350 Jay St. on Wednesday at 11 a.m.