It is (or was, etc) fortunate that.
In a fortunate manner.
At the last possible moment; at the last minute.