Genesis 38:28 NIV

28 As she was giving birth, one of them put out his hand; so the midwife1 took a scarlet thread and tied it on his wrist2 and said, "This one came out first."

References for Genesis 38:28