In this paper, we first address adverse effects of cyber-physical attacks on distributed synchronization of multiagent systems, by providing conditions under which an attacker can destabilize the underlying network, as well as another set of conditions under which local neighborhood tracking errors of intact agents converge to zero. Based on this analysis, we propose a Kullback-Liebler divergence based criterion in view of which each agent detects its neighbors' misbehavior and, consequently, forms a self-belief about the trustworthiness of the information it receives. Agents continuously update their selfbeliefs and communicate them with their neighbors to inform them of the significance of their outgoing information. Moreover, if the self-belief of an agent is low, it forms trust on its neighbors. Agents incorporate their neighbors' self-beliefs and their own trust values on their control protocols to slow down and mitigate attacks. We show that using the proposed resilient approach, an agent discards the information it receives from a neighbor only if its neighbor is compromised, and not solely based on the discrepancy among neighbors' information, which might be caused by legitimate changes, and not attacks. The proposed approach is guaranteed to work under mild connectivity assumptions.