Deuteronomy 24:3

if the latter husband detests her and writes her a certificate of divorce, puts it in her hand, and sends her out of his house, or if the latter husband dies who took her as his wife,