The storied career of one of Hollywood’s most prolific attorneys came to a meek end in a Brooklyn federal courtroom today when Roger Rosen — whose past clients include Phil Spector and Al Pacino — agreed to give up his law practice to avoid an indictment.

The Los Angeles-based lawyer is charged with leaking information from snitches to members of the notorious drug crew run by James Rosemond during 2009 and 2010 – and agreed to abandon his vocation in exchange for a deferred prosecution.

Rosen, 68, tipped off members of Rosemond’s crew to statements made by another one of his clients, Henry Butler, who began snitching to the feds about the sprawling cocaine operation.

Rosemond – who is suspected of setting up the infamous 1994 Manhattan music studio hit on Tupac Shakur – ordered his henchmen to harass Butler because of his cooperation with prosecutors.

The notorious rap honcho was eventually found guilty of drug trafficking raps and faces life in prison at an upcoming sentencing.

Rosen’s ethical misstep abruptly ended a legal career that spanned several decades and included the representation of some of tinseltown’s biggest names.

In addition to his high profile defense of Spector, Rosen has also represented Kim Basinger, Terrence Howard and O.J. Simpson in various legal matters.

Suffering from cancer, the fallen attorney said nothing as he left court today and dashed past photographers as he left the building accompanied by a lawyer.

Prosecutors agreed not to indict Rosen in exchange for his promise to leave his profession and to turn over $22,500 in legal fees.

Rosen asked the court to permit him to take a honeymoon abroad because he was married just five months ago.