ABSTRACT Device-to-Device (D2D) communication offers promising benefits in 5G networks in terms of improved throughput and reduced latency. However, efficient congestion control remains a critical challenge to ensure optimal performance and resource utilization. Existing congestion control mechanisms often struggle with adapting to dynamic network conditions, leading to inefficiencies, such as underutilization of network resources or excessive packet loss. This paper addresses these challenges by proposing a novel Weighted AIMD congestion control algorithm tailored specifically for D2D communication in 5G networks (WACC-D2DC-5GN). Here, the Weighted AIMD Congestion Control Algorithm is proposed for estimating available bandwidth and Hunger Games Search Optimization to optimize the weight parameter of WACC. The proposed algorithm integrates weighted factors that dynamically adjust congestion window sizes based on real-time network feedback. Simulations are run on the NS3-mmWave module, NS3 LTE-A module. The simulation outcomes show that the proposed WACC-D2DC-5GN method attains 27.26%, 20.41%, and 23.26% higher SNR and 16.20%, 26.97%, and 30.34% higher Throughput when analysed with existing techniques like NexGen D-TCP: next generation dynamic TCP congestion control approach (NGD-TCP-CCA), user-centric channel allocation system for 5G higher-speed users by using ML to decrease handover rate (UCC-HSU-MLA), and efficient with reliable hybrid deep learning-allowed method for congestion control in 5G/6G networks (HDL-EMC-CN) respectively.