Elena reconciles with Miguel, accepting both him and music back into the family. The song sparks her memory of Héctor and revitalizes her, and she gives Miguel the torn-out piece of the photo from the ofrenda, which shows Héctor's face. Imelda blesses Miguel with no conditions attached so he can return to the Land of the Living, where he plays a song for Coco that Héctor wrote for her during her childhood. As the sun rises, Héctor is in danger of being forgotten by Coco and disappearing.
Ernesto is crushed by a falling church bell as in his previous life, but the photo falls into the water and disappears. They infiltrate Ernesto's sunrise concert to retrieve Héctor's photo from Ernesto and expose his crimes. Miguel reveals that Héctor's decision to return home to her and Coco resulted in his death, and Imelda and Héctor reconcile. With the help of Dante - who turns into an alebrije - the dead Riveras find and rescue them. Miguel realizes that Héctor is his actual great-great-grandfather and that Coco is Héctor's daughter, the only living person who still remembers him. To maintain his legacy, Ernesto steals the photo and has Miguel and Héctor thrown into a cenote pit. Miguel soon realizes that Ernesto murdered Héctor using a poisoned drink and stole the songs he had written, passing them off as his own to become famous. Ernesto welcomes Miguel as his descendant, but Héctor confronts them, imploring Miguel to take his photo. Héctor attempts to return Miguel to his relatives, but Miguel escapes and infiltrates Ernesto's mansion, learning along the way that an old friendship between the two deteriorated before Héctor's death. In return, Héctor asks Miguel to take his photo back to the Land of the Living so he can visit his daughter before she forgets him and he disappears completely. Miguel encounters Héctor, a down-on-his-luck skeleton who once played with Ernesto and offers to help Miguel reach him. Imelda offers Miguel a blessing but on the condition that he abandon his musical pursuits when he returns to the Land of the Living Miguel refuses and attempts to seek Ernesto's blessing. Discovering that he is cursed for stealing from the dead, Miguel must return to the Land of the Living before sunrise or he will become one of the dead: to do so, he must receive a blessing from a member of his family using an Aztec marigold petal that can undo the curse placed upon him by stealing Ernesto's guitar.
Taking him there, they realize that Imelda cannot visit as Miguel removed her photo from the ofrenda. However, he can see and be seen by his Xoloitzcuintli dog Dante and his skeletal dead relatives who are visiting from the Land of the Dead for the holiday. He enters Ernesto's mausoleum and steals his guitar to use in the show, but becomes invisible to everyone in the village plaza. Concluding that Ernesto is his great-great-grandfather, Miguel ignores his grandmother Elena's objections and leaves to enter a talent show for the Day of the Dead. One day, Miguel inadvertently damages the photo of Coco with her parents at the center of the family ofrenda and removes it, discovering that her father (whose face is torn out) was holding Ernesto's famous guitar. He secretly dreams of becoming a musician like Ernesto de la Cruz, a popular actor and singer of Coco's generation. Ninety-six years later, her great-great-grandson, 12-year-old Miguel, now lives with Coco and their family. She banned music in the family and opened a shoe-making family business. In Santa Cecilia, Mexico, Imelda Rivera was the wife of a musician who left her and their 3-year-old daughter Coco, to pursue a career in music.The synopsis below may give away important plot points.