Simple phase used when someone is surprised quite suddenly.
Person 1: You know my friend right? He's cheating on his girlfriend! Person 2: I'd be damned! When did this start happening?