With the proliferation of the Internet of Things (IoT) in various domains, concerns over information security and user privacy have exponentially escalated. Numerous smart intrusion detection (SID) strategies, primarily based on machine/deep learning techniques, have been proposed to counter these security challenges. However, these strategies are typically designed with a centralized approach, where IoT devices relay their data to a central server for training, potentially exposing the data to a range of security threats and privacy vulnerabilities. To address these data security and privacy challenges, a federated learning (FL) approach is adopted in this study. In this approach, individual users train their local models and transmit only parameter updates to the server. These parameters are then aggregated to form the global model. In each FL training cycle, IoT users receive an updated global model from the central server, which they further train utilizing their respective local datasets. This methodology allows for the preservation of IoT device privacy while optimizing the global model. In the context of IoT edge computing, where computational load is distributed to network edges for efficient resource utilization, a novel SID approach based on federated learning is proposed. The effectiveness of this approach is evaluated using three popular deep learning models and three well-established IoT field datasets. This thorough evaluation serves to assess the generalizability of the models and validate the reliability of the results. Through extensive experiments and comprehensive comparisons with other methodologies, this study demonstrates superior performance, achieving an impressive 99% accuracy rate. This result underscores the robustness of the proposed approach in accurately detecting intrusions within IoT environments, thereby offering a promising solution for securing IoT edge computing.