I frequently hear 「あれ？」 when people find something that catches their attention, often even when a listening party is not present. It seems to have a similar function to "what?", "what's that?", or "huh?".
Since あれ isn't a "question word" itself, was this あれ contracted from a longer sentence? The closest I could think of is 「あれはなんだ？」, but I'm unsure. If it isn't from a longer sentence, is there an explanation behind あれ as a question?
I am also interested in if it was historically contracted from something.