Officer Hector Ayala, 31, was responding to a call for backup at the scene of a fight that involved a large number of people, Montgomery County Police said.
He was traveling west on Randolph Road. As the officer approached Denley Road, his cruiser ran off the road and crashed into a tree around 2:20 a.m.
Officers responding to the same backup call were quickly on the scene.
Ayala was transported to Holy Cross Hospital where he died from his injuries.
The exact cause of the crash was under investigation.
Ayala was a seven-year veteran of the Montgomery Police Department and was assigned to the Fourth District.
The other Fourth District officers who were assigned to the same shift were given off for the rest of their shift. Other officers from around the county were sent in to cover the shift.