The sword of Gryffindor emerges from the Sorting Hat in J.K. Rowling’s Harry Potter and the Deathly Hallows.
During the Battle of Hogwarts, Neville Longbottom draws the sword from the Sorting Hat and uses it to destroy Nagini, one of Voldemort’s Horcruxes. The moment demonstrates both Neville’s courage and the continuing importance of the sword in the final conflict.
The sword can destroy Horcruxes after absorbing basilisk venom in the Chamber of Secrets. Harry previously used it to destroy the diary of Tom Riddle, and Ron used it to destroy Salazar Slytherin’s locket.
The Sorting Hat originally belonged to Godric Gryffindor and is enchanted to sort new students into Hogwarts houses. Its connection with the sword reflects the founder’s legacy and the hat’s role in the school’s history.