Because pterosaur anatomy has been so heavily modified for flight, and immediate transitional fossil predecessors have not so far been described, the ancestry of pterosaurs is not fully understood.
The oldest known pterosaurs were already fully adapted to a flying lifestyle.
Since Seeley, it was recognised that pterosaurs were likely to have had their origin in the "archosaurs", what today would be called the Archosauromorpha.
In the 1980s, early cladistic analyses found that they were Avemetatarsalians (archosaurs closer to dinosaurs than to crocodilians).
As this would make them also rather close relatives of the dinosaurs, these results were seen by Kevin Padian as confirming his interpretation of pterosaurs as bipedal warm-blooded animals.
Because these early analyses were based on a limited number of taxa and characters, their results were inherently uncertain.
Several influential researchers who rejected Padian's conclusions offered alternative hypotheses.
David Unwin proposed an ancestry among the basal Archosauromorpha, specifically long-necked forms ("protorosaurs") such as tanystropheids.
A placement among basal archosauriforms like Euparkeria was also suggested.
Some basal archosauromorphs seem at first glance to be good candidates for close pterosaur relatives due to their long-limbed anatomy; one example is Sharovipteryx, a "protorosaur" with skin membranes on its hindlimbs likely used for gliding.
A 1999 study by Michael Benton found that pterosaurs were avemetatarsalians closely related to Scleromochlus, and named the group Ornithodira to encompass pterosaurs and dinosaurs.

Two researchers, S. Christopher Bennett in 1996, and paleoartist David Peters in 2000, published analyses finding pterosaurs to be protorosaurs or closely related to them.
However, Peters gathered novel anatomical data using an unverified technique called "Digital Graphic Segregation" (DGS), which involves digitally tracing over images of pterosaur fossils using photo editing software.
Bennett only recovered pterosaurs as close relatives of the protorosaurs after removing characteristics of the hindlimb from his analysis, to test the possibility of locomotion-based convergent evolution between pterosaurs and dinosaurs.
A 2007 reply by Dave Hone and Michael Benton could not reproduce this result, finding pterosaurs to be closely related to dinosaurs even without hindlimb characters.
They also criticized David Peters for drawing conclusions without access to the primary evidence, that is, the pterosaur fossils themselves.
Hone and Benton concluded that, although more basal pterosauromorphs are needed to clarify their relationships, current evidence indicates that pterosaurs are avemetatarsalians, as either the sister group of Scleromochlus or a branch between the latter and Lagosuchus.
An 2011 archosaur-focused phylogenetic analysis by Sterling Nesbitt benefited from far more data and found strong support for pterosaurs being avemetatarsalians, though Scleromochlus was not included due to its poor preservation.
A 2016 archosauromorph-focused study by Martin Ezcurra included various proposed pterosaur relatives, yet also found pterosaurs to be closer to dinosaurs and unrelated to more basal taxa.
Working from his 1996 analysis, Bennett published a 2020 study on Scleromochlus which argued that both Scleromochlus and pterosaurs were non-archosaur archosauromorphs, albeit not particularly closely related to each other.

A related problem is the origin of pterosaur flight.
Like with birds, hypotheses can be ordered into two main varieties: "ground up" or "tree down".
Climbing a tree would cause height and gravity provide both the energy and a strong selection pressure for incipient flight.
Rupert Wild in 1983 proposed a hypothetical "propterosaurus": a lizard-like arboreal animal developing a membrane between its limbs, first to safely parachute and then, gradually elongating the fourth finger, to glide.
However, subsequent cladistic results did not fit this model well.
Neither protorosaurs nor ornithodirans are biologically equivalent to lizar
Because pterosaur anatomy has been so heavily modified for flight, and immediate transitional fossil predecessors have not so far been described, the ancestry of pterosaurs is not fully understood. The oldest known pterosaurs were already fully adapted to a flying lifestyle. Since Seeley, it was recognised that pterosaurs were likely to have had their origin in the "archosaurs", what today would be called the Archosauromorpha. In the 1980s, early cladistic analyses found that they were Avemetatarsalians (archosaurs closer to dinosaurs than to crocodilians). As this would make them also rather close relatives of the dinosaurs, these results were seen by Kevin Padian as confirming his interpretation of pterosaurs as bipedal warm-blooded animals. Because these early analyses were based on a limited number of taxa and characters, their results were inherently uncertain. Several influential researchers who rejected Padian's conclusions offered alternative hypotheses. David Unwin proposed an ancestry among the basal Archosauromorpha, specifically long-necked forms ("protorosaurs") such as tanystropheids. A placement among basal archosauriforms like Euparkeria was also suggested. Some basal archosauromorphs seem at first glance to be good candidates for close pterosaur relatives due to their long-limbed anatomy; one example is Sharovipteryx, a "protorosaur" with skin membranes on its hindlimbs likely used for gliding. A 1999 study by Michael Benton found that pterosaurs were avemetatarsalians closely related to Scleromochlus, and named the group Ornithodira to encompass pterosaurs and dinosaurs.
Two researchers, S. Christopher Bennett in 1996, and paleoartist David Peters in 2000, published analyses finding pterosaurs to be protorosaurs or closely related to them. However, Peters gathered novel anatomical data using an unverified technique called "Digital Graphic Segregation" (DGS), which involves digitally tracing over images of pterosaur fossils using photo editing software. Bennett only recovered pterosaurs as close relatives of the protorosaurs after removing characteristics of the hindlimb from his analysis, to test the possibility of locomotion-based convergent evolution between pterosaurs and dinosaurs. A 2007 reply by Dave Hone and Michael Benton could not reproduce this result, finding pterosaurs to be closely related to dinosaurs even without hindlimb characters. They also criticized David Peters for drawing conclusions without access to the primary evidence, that is, the pterosaur fossils themselves. Hone and Benton concluded that, although more basal pterosauromorphs are needed to clarify their relationships, current evidence indicates that pterosaurs are avemetatarsalians, as either the sister group of Scleromochlus or a branch between the latter and Lagosuchus. An 2011 archosaur-focused phylogenetic analysis by Sterling Nesbitt benefited from far more data and found strong support for pterosaurs being avemetatarsalians, though Scleromochlus was not included due to its poor preservation. A 2016 archosauromorph-focused study by Martin Ezcurra included various proposed pterosaur relatives, yet also found pterosaurs to be closer to dinosaurs and unrelated to more basal taxa. Working from his 1996 analysis, Bennett published a 2020 study on Scleromochlus which argued that both Scleromochlus and pterosaurs were non-archosaur archosauromorphs, albeit not particularly closely related to each other.
A related problem is the origin of pterosaur flight. Like with birds, hypotheses can be ordered into two main varieties: "ground up" or "tree down". Climbing a tree would cause height and gravity provide both the energy and a strong selection pressure for incipient flight. Rupert Wild in 1983 proposed a hypothetical "propterosaurus": a lizard-like arboreal animal developing a membrane between its limbs, first to safely parachute and then, gradually elongating the fourth finger, to glide. However, subsequent cladistic results did not fit this model well. Neither protorosaurs nor ornithodirans are biologically equivalent to lizar
Pterosaur