This paper investigates the impact of several comprehensive risks such as credit risk, capital risk, liquidity risk, and insolvency risks on Pakistani banks' technical efficiency to assess the nexus between environmental investments with technical efficiency of banks. It also probes into the effect of competition among the Pakistani banks on technical efficiency. The data envelopment analysis (DEA) CCR and BCC models are used to estimate technical, purely technical, and scale efficiencies of the Pakistani banks. The Lerner index measures the banking competition. For estimation, the bootstrap truncated regression is used as an econometric technique. The robustness of results is cross-checked by using an alternative econometric technique (fractional logit regression) and an alternative competition measure (Boone indicator). The study revealed that capital risk has a positive impact on scale efficiency and insolvency risk has a negative impact on technical and pure technical efficiencies. Similarly, there is a positive significant relationship between technical efficiency and environmental investment. Furthermore, the competition has a significant negative effect on Pakistani banks' technical and pure technical efficiencies. The results suggest that the efficiency of the Pakistani banks is significantly affected by bank size, taxation, diversification, operational cost management, banking development, trade openness, and infrastructure development, which ultimately promotes environmental efficiency and protection. The comparative study indicates that the state-owned banks have higher technical, pure technical, and scale efficiencies than the private, foreign, and Islamic banks.