Birds are the third major evolutionary branch of sauropsids (reptiles), the first being non-archosaurian reptiles and the second being archosaurs (which includes dinosaurs and crocodiles). Birds are highly evolved archosaurs, and thus look nothing like their closest living relatives, the crocodilians. The evolutionary history of birds is long and complex, as they are the latest major branch of the sauropsid group. Previously, it was supposed that birds may have evolved from crocodilians or stem-group archosaurs in the early Mesozoic.
Birds evolved from small dinosaurs around 155 million years ago, directly in the middle of the Mesozoic era. This is the scientific consensus, formed relatively recently — for many decades, the early evolutionary history of birds was unknown and a highly contentious topic. The notion that the evolutionary history of birds began with dinosaurs was proposed by a devotee of Darwin, Thomas Henry Huxley, shortly after the 1859 publication of The Origin of Species, but it wasn't confirmed until the 1960s, when evolutionary biology and comparative anatomy advanced to the point of providing abundant evidence in favor of the relationship.
The evolutionary history of birds is rooted in feathered dinosaurs, animals that we didn't even know existed until a series of crucial finds in China in the 1990s. Apparently, some dinosaurs feathers grew so long that they could use them to glide and eventually fly. This led to a series of evolutionary changes in the direction of modern day birds — hollow bones, higher metabolic rate, beaks, etc. The evolution of birds from the reptilian line is an example of a warm-blooded creature evolving from cold-blooded creatures, something that also happened when mammals evolved from cold-blooded synapsids, our distant ancestors.
The most famous fossil that indicates an evolutionary link between dinosaurs and birds is Archaeopteryx, a dinosaur-bird that lived in the middle Mesozoic. It includes numerous features intermediate between dinosaurs and birds. Although it had feathers, broad wings, and the ability to fly, much of its anatomy had more in common with theropod dinosaurs, such as small teeth, a long, bony tail, and clawed forelimbs.
The evolutionary history of birds experienced a new beginning when the main predators and competitors of birds, dinosaurs and pterosaurs (flying reptiles), went extinct, leaving the skies wide open. Today, birds are a major source of food for carnivorous or omnivorous mammals like felines and humans.