When he neared Thebes, Oedipus came across the Sphinx, a ferocious beast with the head and bust of a woman, and the body of a big cat (usually a lion). The Sphinx had effectively put Thebes under siege, by refusing to let anyone past unless they successfully answered her riddle. Those who failed were killed, possibly by being flung from the nearby cliff, although some appear to have ended up providing the Sphinx with her next meal instead.
The riddle of the Sphinx was: “Which creature has one voice and yet becomes four-footed, two-footed, and three-footed?”
Oedipus correctly guessed a person (crawling infant, adult, and the elderly walking with a stick), causing the Sphinx to self-destruct, probably by throwing herself from the cliff.
Oedipus carried on into the city, where he was welcomed as a hero, married its queen, Jocasta, who was (unknown to him at the time) his mother, became king, and had children who were his half-brothers and -sisters.
https://eclecticlight.co/2017/05/28/...nd-the-sphinx/