Fetching details from the dictionary...

suddenly; casually; accidentally; incidentally; unexpectedly; unintentionally
ふと空を見上げると星が見えた。
When I suddenly looked up at the sky, I saw stars.
ふと気がつくと夜になっていた。
Before I knew it, it had become night.
電車に乗っていてふと彼の顔が浮かんだ。
His face suddenly came to mind.