Summary for those in a hurry
After this comparison, nematodes and hagfish need to be added to the base of the vertebrate/ echinoderm/ deuterostome family tree as outgroup taxa. In other words, hagfish are big nematodes with a notochord. And in turn, so are we.

Figure 1. The hagfish Myxine in vivo patrolling the sea floor. Note the nematode-like tentacles surrounding the mouth end at lower left.
Hagfish (clade: Myxini)
are very low on the vertebrate family tree. According to Wikipedia, “They are the only known living animals that have a skull but no vertebral column, although hagfish do have rudimentary vertebrae.”
With origins in the Cambrian or Ediacaran,
we know of only one fossil hagfish, Gilpichthy greenei (Bardack and Richardson 1977, FMNH PE18703, 5cm; Fig. 2) from the famous Mazon Creek Formation, Late Carboniferous, 307 mya.

Figure 2. Gilpichthys, a Pennsylvanian hagfish, enlarged and full scale.
Without vertebrae,
the Atlantic hagfish (genus Myxine, Linneaus 1758, 50cm, other genera up to 127cm) nest between Vertebrata and more basal taxa. (Not yet added to the LRT).
Outgroup taxa include
lancelets and nematodes (= round worms).
Yesterday
one of those insightful bells rung when I realized nematodes have eversible teeth made of keratin, as in hagfish. Something obvious had, once again, been overlooked. Peters 1991 listed nematodes as vertebrate ancestors based on overall morphology. Hagfish were not included then.
Now
let’s see what other details link nematodes to hagfish, a relationship overlooked by all prior authors, probably due to the great size difference (most nematodes are <2.5mm long), or perhaps due to taxon exclusion. According to Wikipedia, “Taxonomically, they [nematodes] are classified along with insects and other moulting animals in the clade Ecdysozoa,”

Figure 3. Nematodes and hagfish side-by-side, focusing on the eversible mouth parts and keratin teeth.
Classification
According to Wikipedia, “The classification of hagfish had been controversial. The issue was whether the hagfish was a degenerate type of vertebrate-fish that through evolution had lost its vertebrae (the original scheme) and was most closely related to lampreys, or whether hagfish represent a stage that precedes the evolution of the vertebral column (the alternative scheme) as is the case with lancelets. Recent DNA evidence has supported the original scheme.”
We have learned time and again, you can never trust DNA evidence, especially when taxon exclusion is in play. Instead, look at the traits of the taxa under study. And look at lots of taxa to make sure none of them share more traits.
Smithsonian Magazine listed 14 (edited to 7) fun facts about hagfish.
- Hagfishes live in cold waters around the world, from shallow to 1700 m.
- Hagfish can go months without food.
- Hagfish can absorb nutrients straight through their skin.
- Hagfish have two rows of tooth-like structures made of keratin they use to burrow deep into carcasses. They can also bite off chunks of food. While eating carrion or live prey, they tie their tails into knots to generate torque and increase the force of their bites.
- No one is sure whether hagfish belong to their own group of animals, filling the gap between invertebrates and vertebrates, or if they are more closely related to vertebrates.
- The only known fossil hagfish, [Gilphichthys, above] looks modern.
- Hagfish produce slime. When harassed, glands lining their bodies secrete stringy proteins that, upon contact with seawater, expand into the transparent, sticky slime.

Figure 4. Illustration of a nematode with labels from corodon.com. This model has been based on the fresh-water nematode Ethmolaimus. Compare to the hagfish in figure 1.
How does the hagfish compare to an aquatic nematode?
- Tail — The post-anal region forms a tail in both
- Mucus — Moens et al. 2005 report, “Many aquatic nematodes secrete mucus while moving.” The authors did not mention hagfish, which are famous for mucus. Some nematodes also exude adhesive from post-anal, tail tip glands.
- Sensory tentacles — The mouth is in the centre of the anterior tip and may be surrounded by 6 lip-like lobes in primitive marine forms, three on each side. Primitively the lips bear 16 sensory papillae or setae.
- Burrowing into their prey — Both hagfish and nematodes attach their lips to larger prey, make incisions and pump out the prey’s contents with a muscular pharynx.
- Swimming — In water nematodes swim by a graceful eel-like motion as they throw their stiff but elastic bodies into sinusoidal curves by contracting longitudinal muscles (the elasticity of the cuticle and hydrostatic skeleton more or less returns the body to its original straight shape). The notochord in the hagfish gives the same sort of elasticity to the famously wriggly body capable, as in nematodes, to form corkscrews and knots.
- Niche — Nematodes represent 90% of all animals on the ocean floor, not counting hagfish. Both play important roles in dead vertebrate decomposition.
- Embryo development — An alternative way to develop two openings from the blastopore during gastrulation, called amphistomy, appears to exist in some animals, such as nematodes.
- Size –– some species of hagfish and nematode reach 1m in length, though most nematodes are <2.5mm
- Eyes — A few aquatic nematodes possess what appear to be pigmented eye-spots, but most are blind. So are hagfish.
- Reproduction — Usually male and female, sometimes hermaphroditic
- Tough skin and subcutaneous sinus — largely separated from underlying tissue
Evolution from nematode to hagfish
- Head — radially symmetrical evolves to bilaterally symmetrical
- Mouth — three or six lips with teeth on inner edges reduced to two
- Skin and skeleton — Hydroskeleton and cuticle evolve to notochord and ‘eelskin’
- Nerve chord —Dorsal, ventral and lateral in nematodes, reduced to just dorsal in hagfish
- Brain – circular nerve ring in nematodes, dorsal concentration in hagfish
Pikaia gracilens
(Walcott 1911, Middle Cambrian, Fig. Z) has been compared to lancelets and hagfish. Like hagfish, Pikaia retained twin tentacles, but also had cirri instead of rasping eversible teeth.

Figure z. Pikaia gracilens from Mallatt and Holland 2013 showing hagfish and lancelet affinities.
Added 24 hours later
as the question of mouth and anus origin from the original blastopore (Fig. zz) arises again in the comments section.

Figure zz. Blastopre evolution to produce an anus and mouth at the same time in a marine nematode. This is the transitional taxon from protostome nematodes to deuterostomes. This is how it happened. This is how it was ignored in many Western textbooks.
Malakov 1997 writes,
“The blastopore initially has a spherical Caenorhabtitis sp. (Ehrenstein & Schierenberg, shape, but then stretches to become an elongated 1980). oval-shape (Fig. 2). Subsequent development results Embryogenesis in enoplids appears to have several in the lateral edges ofthe blastopore approaching and u.nusual features. Firstly, variability occurs in the eventually connecting with the centre. Two openblastomere arrangement in the stages of early cleavings, one at the anterior end the other at tl1e posterior age. At the four-cells stage various configurations end of the embryo, are persistent remnants of the have been observed, viZ., tetrahedral, rhombic, Tblastopore. The anterior opening provides the beginshaped. These configurations have been variously ning of the definitive mouth, and the posterior one, encountered in the development of nematodes bethe definitive anus.”
See figure z (above). Hagflish and vertebrates arose form marine nematodes exhibiting this form of early cell division. This is how deuterostomes arose.
Malakov 1997 reports, “From these results it may be concluded that enoplids represent an early evolutionary branch, which seperated (sic) from the ancestral nematode stem prior to all other groups of nematodes.”

Figure 5. Medial section of Acipenser (sturgeon) larva with temporary teeth from Sewertzoff 1928. Note this specimen has marginal teeth and deeper teeth.
Getting back to baby sturgeon teeth…
Several months ago I cited Sewertzoff 1928 (Fig. 5) who found tiny teeth in the tiny lava of the large sturgeon, Acipenser. Those tiny teeth disappear during maturity, as you might recall. The question is: are those teeth homologs of keratinous hagfish + nematode teeth? Or homologs of enamel + dentine shark and bony fish teeth? McCollum and Sharpe 2001 in their review of the evolution of teeth reported, “The aim of this review is to see what this developmental information can reveal about evolution of the dentition.”
Unfortunately McCollum and Sharpe 2001 delivered the usual history of citations that indicate teeth started with sharks, overlooking sturgeon, nematode, lamprey and hagfish teeth. Phylogenetic bracketing indicates that baby sturgeon teeth are keratinous, not homologous with dentine + enamel shark teeth, which phylogenetically evolve later, first in sharks and later retained by bony fish. Let me know if this is incorrect.

Figure 6. Ventral view of the GLAHM V830 specimen of Thelodus. This appears to have fang-like teeth, but teeth are too soon. These are barbels = cirri.
Sturgeon barbels:
Are they homologs of hagfish + nematode barbels? Soft tissues, like barbels, are unlikely to fossilize, but one intervening bottom-dwelling taxon, Thelodus (Fig. 6), preserves barbels anterior to the ventral oral opening. Open water thelodonts do not preserve barbels. Catfish barbels appear to be a reversal because a long line of more primitive taxa do not have barbels. The same can be said of the catfish-mimic eel ancestor, the cave fish Kryptoglanis.
The relationship between hagfish and nematodes
should have been known for decades, but apparently this hypothesis of interrelationships has been overlooked, ignored or set to the side until now. If someone else recovered this hypothesis of interrelations previously, let me know so I can promote that citation.
References
Bardack D and Richardson ES Jr 1977. New aganathous fishes from the Pennsylvanian of Illinois. Fieldiana Geology 33(26):489–510.
Linnaeus C 1758. Systema naturæ per regna tria naturæ, secundum classes, ordines, genera, species, cum characteribus, differentiis, synonymis, locis. Tomus I. Editio decima, reformata.
Malakov VV 1998. Embryological and histological peculiarities of the order Enoplida, a primitive group of nematodes. Russian Journal of Nematology 6(1):41–46.
Mallatt J and Holland ND 2013. Pikaia gracilens Walcott: stem chordate, or already specialized in the Cambrian? Journal of Experimental Zoology, Part B, Molecular and Developmental Evolution 320B: 247-271.
McCollum M and Sharpe PT 2001. Evolution and development of teeth. Journal of Anatomy 199:153–159.
Moens T et al. (6 co-authors) 2005. Do nematode mucus secretions affect bacterial growth? Aquatic Microbial Ecology 40:77–83.
Morris CS, Caron JB 2012. Pikaia gracilens Walcott, a stem-group chordate from the Middle Cambrian of British Columbia. Biological Reviews 87: 480-512.
Nielsen C, Brunet T and Arendt D 2018. Evolution of the bilaterian mouth and anus. Nature Ecology & Evolution 2:1358–1376.
Nielsen C 2019. Blastopore fate: Amphistomy, Protostomy or Dueterostome. In eLS (eds) John Wiley & Sons Ltd. DOI: 10.1002/9780470015902.a0027481
Peters D 1991. From the Beginning – The story of human evolution. Wm Morrow.
Sewertzoff AN 1928. The head skeleton and muscles of Acipenser ruthensus. Acta Zoologica 13:193–320.
wiki/Hagfish
wiki/Nematode
wiki/Pikaia
cronodon.com/BioTech/Nematode.html
pterosaurheresies.wordpress.com/2020/08/07/chordate-origins-progress-since-romer-1971/
Hagfish Day, occurs every year on the third Wednesday of October:
smithsonianmag.com/science-nature/14-fun-facts-about-hagfish-77165589/