As good luck would have it
By fortunate chance.
From Shakespeare's The Merry Wives of Windsor, 1600:
You shall hear. As good luck would have it, comes in one Mistress Page; gives intelligence of Ford's approach; and, in her invention and Ford's wife's distraction, they conveyed me into a buck-basket.
The expression is now usually shortened to simply 'as luck would have it'.
See other phrases and sayings from Shakespeare.