Beleaguered Childhood Friend

Someone enters the door of the law office -- it's a childhood friend, and he's accused of murder. The childhood friend goes out to dinner with the protagonist, and they think back to the good ol' days when they used to chase girls, play on the slip and slide, and smoke out in the tree house together.

The main character is determined not to let his Childhood Friend take the fall, and does everything in his power to help out the Friend (usually, in law shows, with the help of a Courtroom Antic). Usually he succeeds.

Almost invariably, the main character discovers that the Childhood Friend is guilty as sin and/or off his rocker, leading the protagonist to wonder how their paths could have diverged so much.

Not to be confused with Unlucky Childhood Friend, which is about a childhood friend falling in love with the oblivious hero. Nor should it be confused with Big Bad Friend, who is still guilty and even actively evil... they just have their life together. Finally, not to be confused with I Want You to Meet An Old Friend of Mine, although the two can overlap if the friend is played by a former colleague of one of the cast.

Subtrope of Childhood Friends. Compare with Broken Pedestal.

Anime

 * Weiss Kreuz provides a variant with an assassin instead of a lawyer: not only is target Koichiro Kase 100% guilty of the crime of the week, he's also 100% guilty for the gambling scandal that ruined Ken's soccer career and attempted to burn him to death. And shot him. Kase is a really, really bad friend.

Film

 * Messala from Ben-Hur is a classic example of this. He's Judah's childhood friend, just returned to the area, and even appears to have a thing for Judah's sister. Then he betrays them all.
 * He's not beleaguered, he was gone for a while, but he's come back to town as a tribune. He wants Judah to help him, but he's not in trouble himself.
 * Twisted in The Fugitive, the protagonist Dr. Kimble is the Beleaguered Childhood Friend.
 * In The Third Man, Holly Martins spends most of the film trying to prove his dead friend's innocence of the bad name he garnered selling diluted penicillin in post WWII Vienna,

Literature

 * In the O. Henry story After Twenty Years,
 * In Guards Guards, Vimes's childhood friend, (or at least fellow member of the streetgang The Cockbill Street Roaring Lads) Lupin Wonse gets seriously beleaguered when he becomes the personal assistant to a dragon. Vimes realises.
 * Of course he wasn't a friend so much as the guy him and his friends picked on. He had implicitly been Vimes' Obstructive Bureaucrat rival for a while and didn't really come to him for help at any point.
 * Novelist Greg Iles' Turning Angel used this to bring the main character into the plot of the story.
 * Subverted in The Dresden Files when
 * In The Regeneration Trilogy, Prior becomes a double agent of sorts--he's working for the Ministry of Munitions during World War One to apprehend pacifists, while trying to shelter a family of pacifists he had known as a child. His unique position looks like it could be very useful for helping his friends, and even getting one of them out of jail.

Live Action Television

 * The Practice has at least one such episode (usually a 2-3 parter) per season.
 * Various Star Treks also would have a fellow from the Starfleet Academy (often an old buddy of the captain's) come in and need desperate help.
 * In Third Watch, this character type was subverted slightly, as Bobby's drug addicted best friend ended up shooting him (Bobby) dead despite Bobby's efforts to help him.
 * Reversed in an episode of Lost: it's Kate, not her friend, who is in trouble with the law. Also, she visits her friend (a doctor) to help her with her mother's illness rather than her legal trouble.
 * Subverted slightly in the Babylon 5 episode "Knives", where an old friend of Londo's comes seeking aid as he is about to be (falsely) declared a traitor to the Centauri Republic. In truth, he wants Londo to kill him in a ritualistic duel which requires the victor to adopt the loser's family into his own, since a conviction of treason would result in execution and the confiscation of everything the convict owns, leaving any surviving family destitute.
 * This starts the plot of Chuck, with the twist that Chuck isn't particularly fond of his former roommate and friend for a very good reason.
 * And subverted when
 * Not childhood, but this happened a number of times on Highlander the Series where an old immortal friend of Duncan's would show up, reminisce some, and then turn out to have either gone bad since Duncan last saw them or to have always been a little bit rotten after all.
 * In an episode of Power Rangers SPD, Sky's best friend from years ago, Dru, shows up unexpectedly after having been Missing in Action. Sky is elated to see him, and it seems as though Syd and Z are smitten with him. However, Jack doesn't trust him, and Sky himself admits that Dru's story doesn't quite check out, but he continues to ignore his suspicions until Dru attempts to assassinate Commander Cruger. Even then, Sky is reluctant to accept the truth and tries to persuade Dru to get help until Dru shoots him.
 * An episode of Buffy the Vampire Slayer, "Lie to Me", involved an old friend of Buffy's named Ford offering Buffy up as a trade to Spike for Ford's becoming a vampire. There was an attempt by Ford to make Buffy understand why he was doing this (he was dying of cancer) but Buffy explained to him that it doesn't make what he was trying to do right. She does try to convince him to save himself (and the others he was bringing with him) but he doesn't listen.
 * Not quite childhood friends, but you can pretty much lay money on the fact that every time an old friend of one of main characters on Law and Order or its spin-offs shows up, they'll be involved in the crime of the week and guilty as sin.
 * An old war comrade of Leo McGarry's turns out to be one of these in The West Wing.
 * And a friend of Toby's comes in asking for whistleblower protection when what he really wants/needs is immunity.

Video Games

 * In Star Wars: Knights of the Old Republic, your party comes across an old and strongly respected friend of  has been accused of murder and asks for your aid in clearing his name.

Visual Novels

 * In the first case of Phoenix Wright Ace Attorney, Wright's old friend Larry Butz is the defendant, although in this case the childhood friend really is innocent.
 * And later,
 * In the Ace Attorney Investigations series, Edgeworth ends up defending Larry.
 * In the Ace Attorney Investigations series, Edgeworth ends up defending Larry.