Initially radar was used for airspace surveillance to detect approaching hostile aircraft.