A singing telegram for a retiring San Francisco judge last week may have struck an off-note with a pair of handcuffs and a Confederate flag patch.

After the usual cake and kind words for retiring superior court judge Richard Kramer, things took a turn for the obscene, or so write the San Francisco Chronicle's Matier and Ross. Sources tell the Woodward-and-Bernstein-but-with mustaches duo that a skimpily dressed "buxom blonde" arrived to perform songs for Kramer. Those included a presumably breathy happy birthday, as the respected jurist had just celebrated his 68th. The entertainment, hired by staffers from a website, went so far as to handcuff Kramer, trading his usual gavel for a whip. Very naughty, your honor.

Most objections to the scene probably have to do with the woman's attire. In addition to a police officer's cap, she sported a Confederate flag patch. As CBS SF notes, the HR director for San Francisco courts will be looking into the matter. “There were good intentions, but it was appalling,” one anonymous source said. Acting presiding judge Teri Jackson, the first African-American woman to serve that role, reportedly fired off her opprobrium in an email.

In a statement, Superior Court spokeswoman Ann Donlan said that “The court already has taken steps to ensure the integrity and dignity of the courtroom are maintained; public resources are used properly; and employees are not exposed to anything that could be considered inappropriate conduct in the workplace.’’

Kramer — who, to reiterate, did not hire the act himself — has many career highlights to celebrate. The judge made legal history in striking down Proposition 22, a state ballot initiative from 2000 that defined marriage as between a man and a woman. Kramer wrote that this was discrimination against gays and lesbians, which was a ruling that the state Supreme Court eventually upheld in 2008, leading voters to pass Proposition 8. The rest, as we know, is history.

Kramer retires next month, though he will continue to work with a private mediation service.

Related: Free Lunch Loving Techbros Reportedly Hooked On SoMa Strip Club Buffet