An exclamation of simultaneous praise and sympathy. What you would say to a person achieving a painful milestone.
Congratudolences on divorcing your husband who ran off with your sister!