The world of Harry Potter is not short on beloved characters, and one that is often highly ranked on fans' lists is Dobby the house-elf. Dobby was first introduced in Harry Potter and the Chamber of Secrets as one of Harry's biggest fans and most loyal allies. However, he doesn't return to the films until Harry Potter and the Deathly Hallows: Part 1. Between the two films, though, Dobby wasn't just sitting around doing nothing. He actually kept busy over the years and remained part of Harry's life between the two stories. So, let's explore what exactly he was doing.

How Dobby Met Harry Potter

Dobby explaining his plan to keep Harry Potter safe

When Harry was twelve years old, he was living with the Dursleys -- his aunt Petunia, uncle Vernon and cousin Dudley. Living with them was extra hard that summer because he had just spent his school year at Hogwarts, where he was a student of magic and surrounded by friends and people who cared for him. However, they never wrote to him that summer which made the summer all the lonelier to be away from them. This, of course, was not a result of their negligence but because of Dobby. Dobby was a great admirer of Harry Potter because he had defeated Lord Voldemort, so when Dobby learned that something dangerous and terrible was going to happen at Hogwarts, he hatched a plan to keep Harry from going to school, which started with cutting off Harry's mail.

RELATED: A Harry Potter Theory Argues Ron Weasley Was a Love Potion Victim - Twice

Harry learned of Dobby's plans when Dobby arrived in his bedroom. Dobby then proceeded to ruin Uncle Vernon's business deal and get Harry barred into his bedroom. But that didn't stop Harry from being rescued by Ron, Fred and George Weasley, so Dobby went even further and sealed the gate to the Hogwarts Express to stop Harry. But Harry found a way to school via the Weasley family's flying car. Then Dobby tried to get Harry injured by a rogue bludger so he'd be sent home. That didn't work either, but Dobby never gave up trying to help. He helped Harry piece together that Lucius Malfoy had planted Tom Riddle's diary on Ginny, framing her for the Chamber of Secrets attacks. For his loyalty and misguided heroics, Harry helped manipulate Mr. Malfoy into freeing Dobby by presenting him with Harry's dirty sock and liberating him from servitude.

What Dobby Did After Leaving the Malfoys

Dobby looking over at something in the Harry Potter movies

After being freed from working for the Malfoys, Dobby traveled the country looking for a new job. However, he was unsuccessful for a couple of years because he had decided he wanted something better than a life of servitude and asked to be paid for his labor. Along his journey, he picked up his friend and fellow dismissed house-elf Winky, vowing to help her in her time of need. It was this act that led him to Dumbledore at Hogwarts.

At Hogwarts, Dobby was paid for his work and got some time off as well. He was able to keep his vow to help Winky and build a life for himself. He used his earnings to buy eccentric clothing, and he had a special affinity for socks. In the Harry Potter and the Goblet of Fire book, this is how he and Harry were reunited; Hermione went to the kitchens and discovered Dobby, bringing Harry to see him again. In the book, it's actually Dobby who provided Harry with the gillyweed he used in the Second Task to survive in the lake.

RELATED: Will Fantastic Beasts: The Secrets of Dumbledore Finally Depict Albus’ Sexuality?

Dobby also helped Harry in Harry Potter and the Order of the Phoenix. Harry and his friends were desperate for a place to run their Dumbledore's Army meetings, where they practiced their Defense Against the Dark Arts without Dolores Umbridge's interference. Dobby introduced Harry to the Room of Requirement, which he called the Come and Go Room. It's interesting that both these gestures were given to Neville in the movie adaptations instead of Dobby. In Harry Potter and the Half-Blood Prince, Harry inherited Kreacher after Sirius died, and Harry sent him to work at Hogwarts, where he eventually enlisted his help and Dobby's house to spy on Malfoy, who was working on a plot to kill Dumbledore.

How Dobby's Bravery and Loyalty Led to His Tragic Death

Dobby using magic at Malfoy Manor in Harry Potter and the Deathly Hallows Part 1

But Dobby returned again in the films and the books. In Harry Potter and the Deathly Hallows, he returned when Harry and his friends were hiding at Sirius' old house. Along with Kreacher, he tracked down Mundungus Fletcher as part of their search for the locket that contained one of Voldemort's Horcruxes. Unfortunately, Harry wasn't able to see him at the house after they infiltrated the Ministry of Magic as planned, though they see each other once more after that. Dobby ended up building some kind of friendly acquaintance with Aberforth Dumbledore, who sent the house-elf to rescue Harry and his friends from the dungeon at Malfoy Manor.

Dobby died when Bellatrix Lestrange threw a knife at him as he disapparated Harry and his friends to safety. He brought them to Shell Cottage, where Ron's brother Bill lived with his wife, Fleur. Dobby died of his wounds in Harry's arms, and his last words were actually Harry's name. This was arguably one of the saddest moments of the entire series, and it was so impactful because of how pure of heart, brave and loyal Dobby was and how special his relationship was with Harry -- a relationship that started in Harry Potter and the Chamber of Secrets and continued throughout the entire series.

KEEP READING: Actors You Probably Forgot Starred In Harry Potter