This article studies consensus of a group of heterogeneous agents with first-order and second-order integrator dynamics in presence of malicious agents. We employ the algorithm where each normal agent ignores large and small relative state values of its neighbors to mitigate the effects of malicious agents. Assuming that the maximum number of malicious agents in the neighborhood of each agent is known, sufficient topological condition is obtained to guarantee resilient consensus in directed networks. The result is further extended to heterogeneous multiagent systems with bounded communication delays. Moreover, impulsive control strategy is introduced in the update schemes and sufficient condition in terms of graph robustness is provided for resilient consensus. Numerical examples are provided to illustrate the effectiveness of the theoretical results. K E Y W O R D S communication delays, heterogeneous multiagent systems, resilient consensus, sampled-data 1 INTRODUCTION Considerable attention has been paid to coordination of multiagent systems in the past decades because of its wide application in many fields, such as distributed computation, mobile robots formation, and intelligent transportation systems. Consensus problem, which is a fundamental problem in multiagent systems, aims at making a group of locally interacting agents reach an agreement upon some quantities of interest. So far, lots of work has been done under different contexts, such as communication delays, 1 noise, 2 quantization, 3 states constraints, 4 and fast consensus. 5 In most of the existing literature on the consensus problem, the agents are cooperative to achieve the global goal. However, some agents may become noncooperative or even malicious when the network is suffering malicious attack or platform-level failures, which will lead to degradation of system performance and even failure of the global goal. Therefore, it is of great importance to consider how to improve the algorithms to avoid system performance being influenced by such compromised agents. Resilient consensus, as a special case of consensus, has long been studied in computer science. A class of algorithms where each normal agent disregards the most deviated agents in the updates has been extensively used for resilient consensus and is often called the mean subsequence reduced (MSR) algorithms. 6 However, this strategy had been studied mostly under complete graphs. In Reference 7, a new concept in graph theory, termed r-robustness, was introduced to study resilient consensus in noncomplete networks. Afterward, a lot of excellent work emerged in discrete-time setting by employing the concept of network robustness and MSR-type algorithms. In References 8 and 9, resilient conditions were obtained for second-order multiagent systems under DP-MSR algorithm, which took an adapted form of the MSR-type algorithms for second-order multiagent systems. In Reference 10, SW-MSR algorithm, which extended MSR-type algorithm by introducing a sliding window, was introduced for multiagent sys...