Police identified the suspect as 22-year-old Ross Truett Ashley of Partlow, Va.
Ashley allegedly ambushed the officer who was making a traffic stop on Thursday afternoon and then fled toward the campus greenhouses, ditching his pullover, wool cap and backpack. He made his way to a nearby parking lot and when a deputy spotted him, he took his own life.
Authorities said Ashley was not connected to the university and did not know the police officer, who was identified as 39-year-old Deriek Crouse.
Crouse was an Army veteran and a married father of five. He joined the campus police force about six months after 33 people were killed in a classroom building and dorm April 16, 2007.
This was the first real test since the mass shooting for Virginia Tech's emergency alert system. In 2007, it took two hours for the first alerts to go out. This time, students received warnings much more quickly.
Crouse was sitting in his unmarked cruiser after pulling over a student when Ashley allegedly walked up and shot him at 12:15 p.m. Police say the student did not have any links to the gunman.
By 12:30 p.m., police received a call from a witness who said an officer had been shot, and within six minutes, the first campus-wide alert was sent by email, text message and electronic signs in university buildings.
Students outdoors went inside buildings. Those already there stayed put. Everybody waited.
School spokesman Larry Hincker said the alert system worked exactly as expected.
"It's fair to say that life is very different at college campuses today. The telecommunications technology and protocols that we have available to us, that we now have in place, didn't exist years ago," he said. "We believe the system worked very well."
It's still unclear why Ashley shot an officer at a school he didn't attend, or why he didn't shoot the deputy who spotted him shortly after the shooting. Investigators are working to determine a motive.
Police say Ashley stole a white Mercedes SUV from a real estate office in Radford, Va., the day before the shooting. He allegedly walked into the business with a gun and demanded the keys to an employee's vehicle. The vehicle was found abandoned at Virginia Tech on Thursday.
The Associated Press contributed to this report.