Yes, it expresses a (usually unpleasant) surprise.

Originally, it was a euphemism of «ёб твою мать» (literally: “(I have) fucked your mother”) which can also express an unpleasant surprise but has...