〜と思いきや
I thought …, but (actually)
Plain form (Noun, な-adj か optional) + と思いきや
Sign up free to review this point on a spaced schedule.
と思いきや sets up an expectation and then overturns it: 簡単に勝てると思いきや、苦戦した, "I thought we'd win easily, but it was a hard fight".
The second half is a surprise: the opposite of what you expected, or something unexpected. It's a lively, slightly playful expression, common in written stories, blogs, TV narration and manga.
It's close to と思ったら and かと思ったら (N2), but と思いきや always involves a mistaken expectation, never just "the moment". と思ったが is the plain equivalent.
Don't use it for your present thoughts. It always looks back at an expectation that turned out wrong. Compare と思って, "thinking that (so I did)", which isn't contrastive.
Examples
簡単に勝てると思いきや、苦戦した。
I thought we'd win easily, but it was a hard fight.
雨がやんだと思いきや、また降り出した。
Just when I thought the rain had stopped, it started again.
彼は怒ると思いきや、笑って許してくれた。
I thought he'd be angry, but he laughed and forgave me.
高いと思いきや、意外に安かった。
I assumed it would be expensive, but it was surprisingly cheap.
今日は休みかと思いきや、店は開いていた。
I thought it might be closed today, but the shop was open.