The former judge maintains the Office of Court Administration punished him at the behest of party leaders because he would not hire Mr. Crespo’s assistant. Court administration officials say it was a routine reassignment that had nothing to do with politics.

Judge Marks declined to be interviewed for this article.

Judgeships are one of the last bastions of machine party power, and Mr. Montano maintains his case highlights a system of patronage that has long existed in courthouses throughout the city, but is especially prevalent in the Bronx, where party leaders maintain a strong hold over the judiciary and district attorney’s office. The party leaders most recently handpicked the borough’s top prosecutor, Darcel D. Clark.

The Bronx Democratic Party has moved to clean up its act since the blatantly corrupt days of Stanley Friedman, the disgraced former party leader who was convicted of federal bribery charges in 1986. Still, it remains one of the most powerful political machines in the city; party bosses call the shots in low-interest races and expect favors — like jobs — in exchange for their support.

“Judgeships are bought,” said one political consultant, who spoke on the condition of anonymity, citing fear of retribution. “The jobs that come out of that office go to the organization — they make the choice of who gets the jobs.”

Mr. Crespo, the party’s chairman, said Democratic leaders only recommend people for positions, and no one is penalized for not hiring the party’s picks.