This randomized controlled trial evaluated the effects of intraoperative intravenous magnesium sulfate versus dexmedetomidine on postoperative pain, analgesic consumption, hemodynamic stability, and respiratory function in patients undergoing elective transurethral resection of bladder tumor (TUR-M) under spinal anesthesia. Magnesium sulfate significantly reduced postoperative pain scores, delayed the time to first analgesic request, and decreased total analgesic consumption compared to dexmedetomidine and control groups, while both agents were hemodynamically and respiratorily safe.