The smith was delighted, but he took good care not to confess to any one who it was that had made the curious lock. He now received one work after another from the king, and let Niels do them all, and he soon became a wealthy man.

In the meantime, the report spread from place to place of the ingenious lock the king had got for his treasury. Travellers came from a great distance to see it, and it happened that a foreign king came also to the palace. When he had examined the work for a long time, he said, that the man who could make such a lock deserved to be honoured and respected. “But however good a smith he may be,” added the king, “I have got his master at home.” He continued boasting in this manner, till at length the king offered to wager with him which could execute the most skilful piece of workmanship. The smiths were sent for, and the two kings determined that each smith should make a knife. He who won was to have a considerable reward. The smith related to Niels what had passed, and desired him to try whether he could not make as good a knife as he had a lock. Niels promised that he would, although his last work had not benefited him much. The smith was in truth an avaricious man, and treated him so niggardly, that at times he had not enough to eat and drink.

It happened one day, as Niels was gone out to buy steel to make the knife, that he met a man from his own village, and, in the course of conversation, learnt from him that his father went begging from door to door, and was in great want and misery. When Niels heard this he asked his master for some money to help his father; but his master answered, that he should not have a shilling before he had made the knife. Hereupon Niels shut himself up in the workshop, worked a whole day, and, as on the former occasion, the knife was made without his knowing how it happened.

When the day arrived on which the work was to be exhibited, Niels dressed himself in his best clothes, and went with his master up to the palace, where the two kings were expecting them. The strange smith first showed his knife. It was so beautiful, and so curiously wrought, that it was a pleasure to look at it; it was, moreover, so sharp and well tempered, that it could cut through a millstone to the very centre, as if it had been only a cheese, and that without the edge being in the least blunted. Niels’ knife, on the contrary, looked very poor and common. The king already began to think he had lost his wager, and spoke harshly to the master-smith, when his boy begged leave to examine the stranger’s knife a little more closely. After having looked at it for some time, he said: “This is a beautiful piece of workmanship which you have made, and shame on those who would say otherwise; but my master is, nevertheless, your superior, as you shall soon experience.” Saying this, he took the stranger’s knife and split it lengthwise from the point to the handle with his own knife, as easily as one splits a twig of willow. The kings could scarcely believe their eyes; and the consequence was, that the Danish smith was declared the victor, and got a large bag of money to carry home with him.

When Niels asked for payment, his master refused to give him anything, although he well knew that the poor boy only wanted the money to help his father. Upon this Niels grew angry, went up to the king, and related the whole story to him, how it was he who had made both the lock and the knife. The master was now called, but he denied everything, and accused Niels of being an idle boy, whom he had taken into his service out of charity and compassion.

“The truth of this story we shall soon find out,” said the king, who sided with the master. “Since thou sayest it is thou who hast made this wonderful knife, and thy master says it is he who has done it, I will adjudge each of you to make a sword for me within eight days. He who can make the most perfect one shall be my master-smith; but he who loses, shall forfeit his life.”

Niels was well satisfied with this agreement. He went home, packed up all his things, and bade his master farewell. The smith was now in great straits, and would gladly have made all good again; but Niels appeared not to understand him, and went his way, and engaged with another master, where he cheerfully began to work on the sword.

When the appointed day arrived, they both met at the palace, and the master produced a sword of the most elaborate workmanship that any one could wish to see, besides being inlaid with gold, and set with precious stones. The king was greatly delighted with it.

“Now, little Niels,” said he, “what dost thou say to this sword?”