In a fortunate manner.
It is (or was, etc) fortunate that.
By serendipity; by blind luck in combination with wisdom; by fortunate accident.