Disclosed are bicyclic derivatives of morphine-6-glucuronide represented by general formula (I). An example of a compound encompassed by general formula (I) includes morphin-6-yl 5-c-(5-hydroxy-4,5,6,7-tetrahydro[1,2,4]triazolo[1,5-a]pyrimidin-2-yl)beta-D-xylopyranoside. The compounds of formula (I) are used to treat pain.