Rivera spent nearly three years in detention, cut off from the outside world, leading advocates to fear for his welfare.