It's considered a mild swear word, expressing frustration, surprise, or annoyance. It's not as strong as "sacré bleu!" (a more forceful exclamation), but it still carries a hint of disapproval.
It's less common in modern French, but you might still hear it used by older generations.