It is commonly used as punchline in a joke involving someone about to receive or do something somewhat desirable (engage in intercourse, win a prize on a game show, make a purchase). The second person mentions something very undesirable in addition to the initial object/act. The first person indicates their displeasure, while the second exclaims the phrase.
2: OMFG! This is the greatest day of my life!
1: But you'll have to time to use that car, as you've won a trip to maximum security prison!
1: IT'S A BONUS! BELIEVE IT!