The ever-increasing number of diverse and computation-intensive Internet of things (IoT) applications is bringing phenomenal growth in global Internet traffic. Mobile devices with limited resource capacity (i.e., computation and storage resources) and battery lifetime are experiencing technical challenges to satisfy the task requirements. Mobile edge computing (MEC) integrated with IoT applications offloads computation-intensive tasks to the MEC servers at the network edge. This technique shows remarkable potential in reducing energy consumption and delay. Furthermore, caching popular task input data at the edge servers reduces duplicate content transmission, which eventually saves associated energy and time. However, the offloaded tasks are exposed to multiple users and vulnerable to malicious attacks and eavesdropping. Therefore, the assignment of security services to the offloaded tasks is a major requirement to ensure confidentiality and privacy. In this article, we propose a green and secure MEC technique combining caching, cooperative task offloading, and security service assignment for IoT networks. The study not only investigates the synergy between energy and security issues, but also offloads IoT tasks to the edge servers without violating delay requirements. A resource-constrained optimization model is formulated, which minimizes the overall cost combining energy consumption and probable security-breach cost. We also develop a two-stage heuristic algorithm and find an acceptable solution in polynomial time. Simulation results prove that the proposed technique achieves notable improvement over other existing strategies. INDEX TERMS Caching, energy, IoT, mobile edge computing, security. DARYOUSH HABIBI (Senior Member, IEEE) received the B.E. degree (Hons.