A riot in an overcrowded prison in northeastern Brazil left nine inmates dead and 20 injured, officials said Thursday.