Who gave Beowulf the magical sword?

It's not magical, but you mean Unferth.