Calcifer is a falling star that Howl caught when he was a child. In exchange for Calcifer's help, Howl gives him his heart. This prohibits Howl from feeling genuine love for anyone or anything other than himself. Sophie regains Howl's heart from the Witch of the Waste and returns it to him, saving him from death. Calcifer is free from the pact but he decides to stay. The spell over Sophie is finally broken, the war ends, and we see the castle flying away with Howl, Sophie, Markos, and the Witch of the Waste on board. Howl and Sophie live happily ever after.
Thanks, mcanna!