Internet of Things is a promising technology but it also increases numerous security threats in data transmission. To secure neighboring sensing devices' communication in an IoT environment, a key agreement protocol is primordial. Various IoT data transmission mechanisms have been proposed in the literature to attain security. However, these propositions are not completely secure against all types of attacks. In this paper, a new certificate-based was proposed lightweight authentication and key agreement protocol for the IoT environment. The proposed protocol uses Elliptic Curves Cryptography and minimizes the number of operations needed to generate secret keys. Moreover, performed a detailed informal security analysis, and formal security verification using Automated Validation of Internet Security Protocols and Applications (AVISPA) tool, through which demonstrated that the proposed protocol is resilient against numerous known attacks. The implementation of the proposed protocol using the simulator to evaluate the impact of the proposed protocol on several network parameters.