First contact with the Tyranids occurred in the year 745.M41, when they emerged on the Eastern Fringe of the galaxy, their Hive Mind drawn by the psychic beacon known as the Astronomicon towards Terra. They attacked the planet Tyran first, continuing towards Terra and consuming all subsequent worlds in their path. This first hive fleet, later known as Hive Fleet Behemoth, would be defeated by the efforts of the Space Marines of the Ultramarines Chapter during the Battle of Macragge, though the Ultramarines would suffer devastating losses after the battle.
In 942.M41, an Imperial Commissar, Ciaphas Cain, discovered hibernating Tyranids whilst on a mission in the ice world Nusquam Fundumentibus. This swarm arrived on the planet when their Hive Ship crashed approximately seven millennia earlier, prior to any human colonisation. Members of the swarm and, subsequently, the Hive Mind, would awaken, but Cain's guardsmen would eventually defeat them. However, the Inquisition was unsettled by the fact that the Tyranids had arrived in the galaxy possibly before the era known as the Age of the Imperium.
In 993.M41, the Tyranids returned to the galaxy with Hive Fleet Kraken which, instead of assaulting its targets as a single massed Hive Fleet, split into countless smaller fleets, each enveloping whole star systems before reinforcements could arrive. The Scythes of the Emperor and Lamenters chapters would bear the brunt of the assault, almost resulting in the former's destruction, but eventually they were successfully repulsed. The fleet was broken following both it's defeats at the Battle of Ichar IV and the Eldar Craftworld Iyanden, though the remaining splinter fleets would survive to wreak havoc as far away as the Tau Empire.
Four years later, another Hive Fleet, Leviathan, would unexpectedly appear from "below" the plane of the galaxy (on the Z axis), attacking from two points and cutting off large portions of the galaxy from reinforcements. However, just as it seemed that the Imperium's forces in Segmentum Solar would be properly tested, the Tyranids were distracted, after being diverted in the star system of a powerful Ork empire. Whilst the Orks managed to stall the main advance of Hive Fleet Leviathan, even their tenacity is likely to fail, with the Fleet reemerging, stronger than ever after having absorbed Orkoid genetic material into their own genome.