BLACKSBURG, Va. - A gunman killed a police officer in a Virginia Tech parking lot Thursday and then apparently shot himself to death nearby in a baffling attack that shook the campus nearly five years after it was the scene of the deadliest shooting rampage in modern U.S. history.

The shooting took place on the same day Virginia Tech officials were in Washington, fighting a government fine over their alleged mishandling of the 2007 bloodbath in which 33 people were killed.

Before it became clear that the gunman in Thursday's attack was dead, the school applied the lessons learned in the last tragedy, locking down the campus and using a high-tech alert system to warn students and faculty to stay indoors.

"In light of the turmoil and trauma and the tragedy suffered by this campus by guns, I can only say words don't describe our feelings and they're elusive at this point in time," university president Charles Steger said. "Our hearts are broken again for the family of our police officer."

The officer was killed after pulling a driver over in a traffic stop. The gunman - who was not involved in the traffic stop - walked into the parking lot and ambushed the officer.

The officer was identified as Deriek W. Crouse, 39, an Army veteran and married father of five who joined the campus police force about six months after the 2007 massacre, the school said. He previously worked at a jail and a sheriff's department.

State police were still investigating whether he had been specifically targeted. The campus force has about 50 officers and 20 full- and part-time security guards.

A law enforcement official who spoke on condition of anonymity confirmed the gunman was dead.

While authorities would not confirm specific details about the gunman, they released a timeline of events.

About 12:15 p.m., the officer called in the traffic stop. After a few minutes passed without hearing from the officer, dispatch tried to reach him, but didn't get a response. About 15 minutes later, police received the first call from a witness who said an officer had been shot at the Cassell Coliseum parking lot and the gunman had run away.

Local, state, and federal officials responded immediately. At 1 p.m., an officer saw a man with a gunshot wound in a parking lot known as the Cage. A gun was lying nearby. Authorities said they found that there were no other threats and lifted the campus lockdown, about four hours after the initial alerts.

Asked if police were still looking for the shooter, State Police Sgt. Robert Carpentieri said: "I think the investigators feel confident that we've located the person. I can't give you specifics and I don't want to confirm that, but you can kind of read between the lines, so I won't specifically address that question."

At the time of the shootings, students were preparing for exams when they were suddenly told to hunker down. Officers swarmed the campus as caravans of SWAT vehicles and other police cars with emergency lights flashing patrolled nearby.

The university sent updates about every 30 minutes, regardless of whether there was any new information, school spokesman Mark Owczarski said.

Harry White, 20, a junior physics major, said he was in line for a sandwich in a campus building when he received the text-message alert.

White said he did not panic, thinking instead about a false alarm about a possible gunman that locked down the campus in August. White used an indoor walkway to go to a computer lab in an adjacent building, where he checked news reports.

"I decided to just check to see how serious it was," he said. "I saw it's actually someone shooting someone, not something false, something that looks like a gun."

The school was a bit quieter than usual because classes ended Wednesday. About 20,000 of the university's 30,000 students were on campus when the officer was shot. Exams, set to begin Friday, were postponed.

The shooting came soon after the conclusion of a hearing where Virginia Tech was appealing a $55,000 fine by the U.S. Education Department in connection with the university's response to the 2007 rampage.

The department said the school violated the law by waiting more than two hours after two students were shot to death in their dorm before sending an e-mail warning. By then, student gunman Seung-Hui Cho was chaining the doors to a classroom building where he killed 30 more people and then himself.

The department said the e-mail was too vague because it mentioned only a "shooting incident," not the deaths. During testimony Thursday, the university's police chief, Wendell Flinchum, said there were no immediate signs in the dorm to indicate a threat to the campus. He said that the shootings were believed to be an isolated domestic incident and that the shooter had fled.

An administrative judge ended the hearing by asking each side to submit a brief by the end of January. It is unclear when he will rule.