It happened with the plane still outside the battle zone. Ground control knew the pilot was dying even before he realized it; human physiological interoception was no match for surgically implanted sensors and fast signal analysis.
Human reflexes and tactics were no match for software either, and the plane kept winning dogfights while its pilot died, and long afterwards. Its job done, it flew itself back to base.
The landing was flawless. An ambulance was already waiting to take the corpse to the base hospital, where he would later die of his wounds after a battle as courageous as the one he had just won, both grieving and inspiring an entire nation.