It is Aarne-Thompson type 440, the Frog King. Another tale of this type is The Well of the World's End.
In the tale, a spoiled princess sits by a well and accidentally drops a golden ball into it that she was playing with. Distraught that her father will scold her for losing the royal heirloom, the spoilt princess cries until the Frog Prince emerges from the well and offers to retrieve the golden ball if she agrees for him to become her companion. Still distraught, the spoilt princess agrees and the Frog Prince retrieve it for her, but the princess snatches it and runs away because the Frog Prince disgusts her.
The Frog Prince chases after the spoilt princess who tells her father the King about the Frog Prince. Her father demands she keep her word and keep the Frog Prince as a companion, who sits by her at the dinner table, eats from her food and drinks from her cup, and every request is met with reluctance and disgust by the princess. Finally asking to sleep in the spoilt princess's bed, this is the last straw and the spoilt princess picks up the Frog Prince and throws him at the wall, who then magically transforms into a handsome prince (in the original Grimm version of the story). However, in most modern versions the transformation is invariably triggered by the princess kissing the frog.
The Frog Prince also has a loyal servant named Henry (or Harry) who had three iron bands affixed around his heart to prevent it from breaking in his sadness over his master's curse, but when the Prince was reverted back to his human form, Henry's overwhelming happiness caused all three bands to break, freeing his heart from its bonds.
Similar folk talesEditA Russian folk version "Tsarevna Lyagushka" (The Frog Princess) has the male and female roles reversed: the male prince Ivan Tsarevich discovers the enchanted female frog who becomes Vasilisa the Wise, a female sorceress.
An Anglo-Scottish Border fairy tale called "The Well of the World's End" is very similar, except the princess is persecuted by her wicked stepmother - and not her father - who demands fill a sieve with water from the Well of the World's End, and later demands she keep her promise to the Frog Prince.