It is Aarne-Thompson type 516. Others of this type are Father Roquelaure and The Raven. Antti Aarne and Stith Thompson catalogued about 500 tales under this type, of which over 200 were Irish, and the remainder, from the rest of Europe and European colonies in America. Such tales include In Love with a Statue, How to find out a True Friend, The Man of Stone, and Amis et Amiles.
In some variants, a king on his deathbed orders his servant, Trusty John, not to let his son see a certain room, which holds a portrait of a princess.
In all variants, when the new king comes to power, he forces his way into the room. Instantly, he falls in love with the princess. In Joseph Jacobs's version, her country had been at war with his, and the portrait stems from betrothal negotiations that had fallen through; but in all versions, the king does not know how to win her. Trusty John tells him to prepare a ship with all manner of rich treasure, and then either sails with it himself, or has the king sail with him, to her country. The princess is lured aboard by the goods, and the ship sets sail, carrying her off.
While they travel, John hears three ravens. One says that as soon as they reach shore, a horse will come; if the king mounts it, it will carry him off or dash him and the princess to pieces. The solution is for ssomeone to kill the horse, but anyone who reveals this by stating it out loud would have his legs turn to stone up to the knees. The second raven says (with variations in different tellings) that the king would be killed by wine at the wedding feast if it were not dashed to the ground, or that he would be burned up by a wedding garment if it was not burned, etc.; in all variants, whoever says so would turn to stone to his waist. The third raven says, again in different variants, that the princess would faint and dies unless someone draws three drops of blood from her before the king touches her; or a dragon would attack their bridal chamber and unless driven off, kill them. True to form, whoever states this would turn entirely to stone.
John prevents all three fates. For the first two, the king trusts that John has acted in his service; but for the third, the king decides to execute him. At the place of execution, John tells the story of the ravens and turns progressively to stone.
In time, the queen bears twin sons. The king and queen learn that if they kill the boys and rub John's statue with their blood, he would come to life again. When the princess agrees to the sacrifice, Faithful John immediately comes back to life, the curse broken. The king and queen live happily ever after.