The Talmud
בכורות דף י״טBechorot 19b
Amud b of Bechorot 19 — the second side of the page
English rendering prepared for The Gematria — not a historical translation.
Bekhorot 19b · בכורות י״ט ב
אי למעוטי היכא דיצתה נקבה לפניו מפטר רחם נפקא אלא שמע מינה בכור למעוטי היכא דיוצא אחר יוצא דופן
If it is to exclude the case where a female came out before it, that is derived from "that opens the womb". Rather, learn from this that "firstborn" comes to exclude the case where one comes out after a yotzei dofen.
אמר ליה רב אחא מדפתי לרבינא אי סלקא דעתך בכור לדבר אחד הוי בכור תינח היכא דיצא זכר יוצא דופן וזכר דרך רחם דלא קדוש דאימעוט לידה מבכור דבכור לרחמים איכא בכור לזכרים ליכא
Rav Acha of Difti said to Ravina: if it should enter your mind that a firstborn in one respect only is a firstborn, it is well where a male came out through the side and a male through the womb, that the second is not sanctified — for that birth was excluded by "firstborn", since there is here a firstborn as to the womb but there is no firstborn as to the males.
אלא היכא דיצתה נקבה דרך דופן וזכר דרך רחם ליקדש דהא איכא בכור לזכרים ובכור לרחם אלא מחוורתא כדאביי:
But where a female came out through the side and a male through the womb, let it be sanctified — for here there is a firstborn as to the males and a firstborn as to the womb alike! Rather, it is clear as Abaye said.
הדרן עלך הלוקח עובר פרתו
We shall return to you, "One who buys the foetus of his cow".
Talmud Bavli, Wikisource edition, via Sefaria — CC BY-SA 4.0. English rendering prepared for The Gematria — not a historical translation.