Harry Potter and the Deathly Hallows
by J.K. Rowling
Dobby's character has always been marked by two things: his love of freedom and his love of Harry Potter. These two things go hand-in-hand, of course, because Harry is the one who made Dobby a free elf. Dobby's loyalty to Harry goes all the way to his last breath; he's one of the saddest casualties in the struggle against Voldemort. His last act is one of love and self-sacrifice He's sent by Aberforth to rescue Harry, Ron, Hermione, and the others from Malfoy Manor, and he does everything Harry asks him to… and it costs him his life. His last words are "Harry Potter," poignantly demonstrating his trust and faith in his hero.