Virginia Tech police officers console one another as they move toward the scene where a fellow police officer was killed in a parking lot on the campus of Virginia Tech, Thursday December 8, 2011, in Blacksburg, Va.

By ERIC TUCKER and ZINIE CHEN SAMPSON, The Associated Press, The Associated Press

Posted Dec. 08, 2011, at 1:12 p.m.

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 up 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 where 33 people were killed. Before it became clear that the gunman in Thursday’s attack was dead, the school applied the lessons learned during the last tragedy, locking down the campus and using a high-tech alert system to warn students and faculty members 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. Police did not know what the motive was and they didn’t release the identity of the officer or shooter.

Story continues below advertisement.

A law enforcement official who spoke on the condition of anonymity confirmed the gunman was dead, but wouldn’t say how he died.

While authorities wouldn’t reveal specific details about the gunman, they released a timeline of events.

At 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 get in touch with 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 fled on foot.

Local, state and federal officials responded immediately. At 1 p.m., an officer saw a suspicious man in a parking lot known as The Cage. The man had a gunshot wound and a gun was nearby.

Authorities said they responded to numerous other calls of suspicious activity, but found no 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.”

The officer had served four years on the campus police force, which has about 50 officers and 20 full- and part-time security guards. State police were still investigating whether the officer had been specifically targeted.

Many students were preparing for exams when they were suddenly told to hunker down. Heavily armed officers swarmed the campus as caravans of SWAT vehicles and other police cars with emergency lights flashing patrolled nearby.

“A lot of people, especially toward the beginning were scared,” said Jared Brumfield, a 19-year-old freshman from Culpeper, Va., who was locked in the Squires Student Center.

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

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

White said he didn’t 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. I saw it’s actually someone shooting someone, not something false, something that looks like a gun,” White said.

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 email 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 email 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 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.

Since the massacre, the school expanded its emergency notification systems. Alerts now go out by electronic message boards in classrooms, by text messages and other methods. Other colleges and universities have put in place similar systems.

Universities are required under the Clery Act to provide warnings in a timely manner and to report the number of crimes on campus.

Andrew Goddard, who has crusaded for stiffer run control laws since his son Colin was wounded in the 2007 shootings, said Virginia Tech’s response seemed substantially better this time.

“It sounds like things moved very, very fast this time as opposed to the time before,” said Goddard, who has a daughter and nephew that go to the school. “That doesn’t surprise me. Virginia Tech really did get the message in the sense that when bad things are happening, you have to ask quickly.”

Monica Borza, a senior majoring in biological studies from Virginia Beach, said in an email to AP that she chose to attend Virginia Tech because she thought she would be able to feel safe there.

“The dedication of the officers today confirmed my decision,” said Borza, who was at the Blacksburg public library when she got a text alert about the shooting.

“Within minutes, all my friends and family checked in with me to make sure that I was safe,” she said. “For the next couple of hours, my phone was constantly going off with text messages and phone calls saying, ‘Are you okay?’ ‘Praying for VT!'”

During about a one-hour period on Thursday, the university issued four separate alerts.

Derek O’Dell, a third-year veterinary student at Virginia Tech who was wounded in the 2007 shooting, was shaken.

“It just brings up a lot of bad feelings, bad memories,” said O’Dell, who was at his home a couple of miles from campus at the time of the shootings.

“At first I was just hoping it was a false alarm,” he said. “Then there were reports of two people dead, and the second person shot was in the parking lot where I usually park to go to school so it was kind of surreal.”

On Thursday night, about 150 students gathered silently for a candlelight vigil on a field facing the stone plaza memorial for the victims of the 2007 massacre. Though the official vigil was moved to Friday evening, many turned out anyway to show their support. One student came forward to invite everyone back a day later. He shouted, “Let’s go!” The crowd responded, “Hokies!”

Police would not rule out a connection between the shootings and an armed robbery Wednesday in Radford, about 10 miles from Blacksburg. According to media reports, Radford police were looking for a man they considered armed and dangerous after an armed robbery at a local real estate office.

In August, a report of a possible gunman at Virginia Tech set off the longest, most extensive lockdown and search on campus since 2007. No gunman was found, and the school gave the all-clear about five hours after sirens began wailing and students and staff members started receiving warnings.

The system was also put to the test in 2008, when an exploding nail gun cartridge was mistaken for gunfire. Only one dorm was locked down during that emergency, and it reopened two hours later.