Castro ceded power to his brother Raul Castro at the end of July after undergoing intestinal surgery .