〜とは (surprise)
(I'm amazed) that, to think that
Plain form + とは (…思わなかった · 驚いた)
Sign up free to review this point on a spaced schedule.
After a plain form, とは expresses surprise or disbelief: 彼が優勝するとは、誰も思わなかった, "no one imagined he would win".
It's the written, slightly formal version of なんて (N3). It's often followed by 思わなかった, 驚いた or 信じられない, or left hanging as an exclamation: こんな所で昔の友達に会うとは, "fancy meeting an old friend in a place like this!"
とは also defines words (「積ん読」とは…, N3). Context tells you which: a definition explains a term; surprise reacts to a fact.
まさか often comes earlier in the sentence to strengthen it: まさか試験に落ちるとは思わなかった.
Examples
彼が優勝するとは、誰も思わなかった。
No one imagined he would win.
こんな所で昔の友達に会うとは。
Fancy meeting an old friend in a place like this.
一日でこんなに雪が積もるとは驚いた。
I was amazed that this much snow could fall in a single day.
まさか試験に落ちるとは思わなかった。
I never thought I'd fail the exam.
子どもにこんな絵が描けるとは、すごい。
It's amazing that a child can draw a picture like this.