A process for demetallizing, desulfurizing, and hydrocracking heavy fuel oil with the production of lighter distillates and gas. It is intended for heavy hydrocarbons including residues, tar, and shale oil. The oil is hydrogenated in an ebullated fluidized bed containing catalyst granules