"War makes strange bedfellows."
"If Hitler invaded Hell, I would make at least a favourable reference to The Devil in the House of Commons."
— Winston Churchill, following Hitler's invasion of Russia
"The enemy of my enemy is my enemy's enemy. No more. No less."
— Maxim 29 of "The Seventy Maxims of Maximally Effective Mercenaries", Schlock Mercenary
"To be a spy you need physical fitness, a facility with languages, a tolerance for exotic food and the bugs that come with them. But ultimately there's no greater qualification than the ability to look someone who ruined your life in the eye and say "Let's work together"."
— Michael Westen, Burn Notice
Lash: Tee hee hee! I'm going to break everything!
Sonja: I don't understand why we work so well together...
— Advance Wars: Dual Strike
Mr. Dr. Possible: Sometimes it takes something like this to bring hero and villain together to work for the common good.
Ron: This happened to you before?
Mr. Dr. Possible: No! Heavens no. But in college I wrote a Captain Constellation fanfic with a very similar scenario.
"Fate has us meet as foes, but this ring will make us brothers."
— The Gravemind, Halo 2
"Do not shoot, but listen! Only you can halt what he has begun. Let me guide you safely to our foe."
— The Gravemind, Halo 3
"A friend is one who has the same enemies as you have."
"My enemy's enemy is a problem for later. In the meantime, they might be useful."
Angel: Let's say we come up rolling sevens and this does go our way. We tear up this firm, someone's going to have to step in — And I know that's what you want. And I'm a lot more comfortable with the thought of you in that position than anyone else.
Lindsey: The devil you know?
Angel: That'd be you.
Lindsey: And what if you roll snake eyes?
Angel: You'll talk your way out of it; tell 'em I forced you to help me. Tell 'em I made my "scary face."
—Angel, "Not Fade Away"
"I find that when you intend to betray someone powerful, it's best not to be his only enemy."
— Garn, Shadows Of Enchantment
Grif: So now we're forced to work together. How ironic.
Simmons: No, that's not ironic. Ironic would be if we had to work together to hurt each other.
Donut: No, ironic would be instead of that guy kidnapping Lopez, Lopez kidnapped him.
Sarge: I think it would be ironic if our guns didn't shoot bullets, but instead squirted a healing salve that cured all wounds.
Caboose: I think it would be ironic if everyone was made of iron.
TWO HOURS LATER
Church: Okay. (slowly) We're all agreed that while the current situation is not totally ironic, the fact that we have to work together is odd in an unexpected way that defies our normal circumstances. Is everybody happy with that?
Vegeta: Every fiber of my being wants to puke at once when I say this, but I need your heh...I need your helll-
Gohan: You need our help?
Vegeta: That, yes.
"A common danger unites even the bitterest enemies."
"Look, we both said a lot of things that you're going to regret, but I think we can put our differences behind us. For science. You monster."
— GLaDOS, Portal 2
"Oh man, cooperation amongst enemies! I swear we'd be like in a Saturday night Christmas Special or something."
"Look, even if you think we're still enemies, we're enemies with a common interest: revenge! You like revenge, right? Everybody likes revenge! So let's go get some!"
— GLaDOS, Portal 2
"A common enemy unites even the deepest of foes."
"Sometimes when a threat is great enough... you have to turn to your enemies for help."
— Randy Marsh, South Park, "It's A Jersey Thing"
Giganta: If you think you're locking us up while the whole world is under attack, you got two fights on your hands.
(Justice League / Legion of Doom Death Glare)
Batman: ...She's right. We'll need all the bodies we can throw at this.
Superman: Oh, come on! It's Lex-Flippin-Luthor! Why should we trust him?
Atomic Skull: Hey, it's our world too!
Lex Luthor: Let's be clear about this: we're not here to help you save the world, you're here to help me get revenge on Darkseid. When this is over, it's back at business as usual.
Superman: ...Wouldn't have it any other way.
— Justice League, "Destroyer"
"My people have a saying: "Seek the enemy of your enemy, and you will find a friend"."
— Urdnot Wrex, Mass Effect 1
"If we didn't hate the same people, we would have a friendship based on nothing."
— Texts From Last Night
"Though Mister Sinister may seem an odd ally, the pragmatism of "the enemy of your enemy is your friend" seems to apply."
— Beast, X-Men
Paperinik: Incredible. I'm fighting alongside my worst enemy.
Gorthan: Cherish the moment... and watch your back.
— Paperinik New Adventures, "Mekkano"
Penny: I always felt like I had this little safety zone, because a lot of the things I cared about... I didn't really care about. I don't really need the perfect shoes, it's just fun to pretend I do. And I could look at her and not really care. So she fools peons into thinking she's hot, so what? Who'll care in a few years? We're all going to college and startups. Except... so is she. She'll go far in this world. And she'll get whatever she wants... by making dozens, hundreds, of people feel feel like you do now. And we gave her that power. So it'll be our fault. Unless... (offers her hand) Ready to save the world, you post-ironic post-yuppie?
Aggie: Since seventh grade. What took you so long?
— Penny and Aggie, "The Popsicle War"
"Clank's right. For the sake of our own survival (and for drama), we must set aside our petty squabbles and act together as a single unit!"
— Qwark, Ratchet & Clank: All 4 One
The year 1939 marked a profound change for humanity. Just how drastic was this transition? Simply put, mankind no longer had the luxury to engage in the act of killing each other.
Kirk: The enemy of my enemy is my friend.
Spock: An Arabic proverb attributed to a prince who was betrayed and decapitated by his own subjects.
Kirk: Well, it's still a hell of a quote.
— Star Trek Into Darkness, while discussing an alliance with Khan.
Like I said before, Yards dislike the south Vietnamese... they dislike the Americans... but they hate the north Vietnamese....
— Frank Castle, The Punisher Invades the Nam
"We can get back to hating each other after we save the world from total time implosion. Okay?"
— Atomic Robo, on teaming up with Dr. Dinosaur
ryan218: Agreed. 'The enemy of my enemy is my friend.'
starswordc: Wrong. The enemy of my enemy might be a potential ally, but when enemy #1 is already known for certain from multiple encounters to be composed entirely of omnicidal maniacs who have never once claimed to be otherwise, I'd at least give serious thought to taking a look at whether joining up with enemy #2 might be more useful. Especially when your standing orders preclude going with enemy #1.
If we're going with cliches, in this case "the devil you know" is Satan himself.
Gandalf: Dread has come upon you all! An army of Goblins with claim to the treasure comes from the north! Behold! They ride upon wolves!
Thorin: Oh, great Elf-king! My truest friend and ally! We must join forces against this common scourge!
Thranduil: But... of course... o noble King under the Mountain. Your people are like brothers unto mine.
Bard: And my Men and all their weapons are as one with yours. Together, we shall vanquish the foul foe!
Bilbo: (to himself) Thorin is correct, I simply do not understand war.
— The Hobbit, interrupting the battle between the three forces mid-charge.
Sol: I've been conjuring a plan to seal Justice away, and even if getting rid of her does not end this war, it is the only option we have at hand.
Ky: Sol! I will never agree with your brutish methods. But...as logic calls for it, we shall assist you!
Sol: Agh, for Christ's sake, I was actually kinda hoping that you'd fight me instead. In case you haven't realized, I don't like working with you.
Ky: Get used to it. We're leaving at once.
Sol: Heh, after you.
I know you despise me. And I know how badly you want to see me dead. But I”m willing to bet that I know a man whom you hate even more. I’m offering you an opportunity for revenge.
— Walter White, Breaking Bad