Queens DA Richard A. Brown — New York City’s longest-serving district attorney and an icon among Gotham prosecutors — died early Saturday. He was 86.

Brown, who held the position for nearly 28 years, passed away at the Meadow Ridge assisted-living facility in Redding, Conn., surrounded by his wife, Rhoda, three children and two granddaughters, one a West Point cadet.

The prosecutor, who had suffered from Parkinson’s disease, announced in March he would step down on June 1, but he checked into the facility after falling at his home.

A 1956 NYU law-school graduate, Brown worked for lawmakers in Albany and served as a state Supreme Court judge in Queens until Mario Cuomo appointed him DA in 1991.

Five months later he was elected to the job, and then re-elected six more times, with his last four-year term starting in 2015.

In his tenure, his office created the state’s first drug courts, along with an array of specialized units.

Public officials poured out praise for the respected lawyer, dubbed Judge Brown, who changed the way prosecutors handle cases involving prescription pills, mental-health issues, veterans affairs and animal cruelty.

Gov. Cuomo called him “a giant of the legal community.”

“My father recognized Judge Brown’s brilliance when he appointed him to serve as Queens County District Attorney and 27 years later was proven right,” the governor said in a statement. “He took on the scourge of opioid addiction, fought to protect domestic violence victims, worked to end human trafficking and so much more.”

Wrote Manhattan DA Cy Vance: “Judge Brown was an extraordinary lawyer who dedicated his life to public service. I will remember him first as a friend. He was always available for advice, often delivered with a wicked sense of humor.”

Nassau County DA Madeline Singas, who worked for Brown, called him “a great man, my first boss and the person who showed me how to live a life in service.”

Mayor de Blasio lauded him as a “dedicated public servant” who “brought hundreds of men and women into law enforcement.”

Tweeted NYPD commissioner Jim O’Neill of Brown: he “was as much responsible for NYC’s historic drop in crime as the hardworking cops who brought solid gun, drug & many other cases to his office.”

And Brown’s former homicide bureau chief, Judge Greg Lasak, said working for him was “the honor of a lifetime.”

“Personally, I’ll be forever grateful for the opportunities he gave me and the faith he had in me to serve alongside him.”

It wasn’t all smooth sailing.

Brown took heat after the police shooting of Sean Bell, an unarmed man killed by cops outside a Queens nightclub in 2006. Officers fired 50 shots at Bell and two friends — then were cleared at trial — sparking protests against police conduct.

One of his assistants, Claude Stuart, was forced to resign in 2002 and had his license suspended after he lied to a judge to secure a murder conviction.

Reform advocates criticized Brown for going after low-level marijuana offenders and opposing plans to legalize recreational use.

Overall, he left an exemplary legacy, and as The Post editorial board wrote, “he has reason to be proud that Queens boasts the city’s highest conviction rate.”

Queens Borough President Melinda Katz hailed his “ extraordinary devotion and distinguished service.”

“I will forever and fondly remember his kindness to me and to my entire family throughout the years.”

Funeral services are set for 11:30 a.m. Tuesday at The Reform Temple of Forest Hills, Queens.

Additional reporting by Nolan Hicks