It's both. It's a prepositional phrase in form, but an adverbial phrase in function. The same is true of many prepositional phrases, perhaps even most of them.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.