We address the problem of state estimation of the power system for the Smart Grid. We assume that the monitoring of the electrical grid is done by a network of agents with both computing and communication capabilities. We propose a security mechanism aimed at protecting the state estimation process against false data injections originating from faulty equipment or cyber-attacks. Our approach is based on a multi-agent filtering scheme, where in addition to taking measurements, the agents are also computing local estimates based on their own measurements and on the estimates of the neighboring agents. We combine the multi-agent filtering scheme with a trust-based mechanism under which each agent associates a trust metric to each of its neighbors. These trust metrics are taken into account in the filtering scheme so that information transmitted from agents with low trust is disregarded. In addition, a mechanism for the trust metric update is also introduced, which ensures that agents that diverge considerably from their expected behavior have their trust values lowered.