Almost . . .~ed (하마터면) . . . ~ (으)ㄹ 뻔 했다

Indicates that the event described has almost/nearly happened, but did not.