〜ことに
to (my) surprise, (unfortunately, strangely)
Emotion adjective / Verb た-form + ことに
Sign up free to review this point on a spaced schedule.
ことに at the start of a sentence gives the speaker's feeling about what follows: 驚いたことに、彼は一人で全部やった, "to my surprise, he did it all himself".
It follows words of emotion: 驚いた, 残念な, うれしい, 不思議な, ありがたい, 困った. Together they work like English adverbs: "surprisingly", "unfortunately", "to my delight", "strangely", "thankfully".
It's written and slightly formal, common in essays, speeches and narration. In conversation, people often just say 残念だけど or びっくりしたけど.
Don't confuse it with ことから ("from the fact that") or ことで ("by doing").
Examples
驚いたことに、彼は一人で全部やった。
To my surprise, he did it all by himself.
残念なことに、試合は中止になった。
Unfortunately, the match was called off.
うれしいことに、友達が会いに来てくれた。
To my delight, a friend came to see me.
不思議なことに、誰もその音を聞いていなかった。
Strangely, nobody had heard the sound.
ありがたいことに、みんなが手伝ってくれた。
Thankfully, everyone helped me.