It's a genitive form, preserved in an old prepositional phrase.
Most of the Norwegian case system, inherited from Old Norse, fell into disuse over 500 years ago, but there are still remnants of it left.
This can be seen in genitive endings used to express possession (-s), and in the distinction between subject pronouns (nominative), and object pronouns (accusative), as well as in old prepositional phrases such as the above.
Bare hyggelig, Heike!
A few common examples:
til fots = (travel) by/on foot
til lands = (travel) by/on land
til vanns = (travel) by/on water
til fjells = to/in the mountains
til skogs = to/in the woods
til sjøs = to/on the sea
til bords = to/at the table