For more on the shooting, see the later report, “Violence Revisits Virginia Tech After Two Are Killed in Shooting.”

Two people, including a police officer, were dead after a shooting on Thursday afternoon on the campus of Virginia Tech, the scene of a 2007 massacre in which 33 people were killed, university officials said.

The shooting took place around noon, after a campus police officer made what was described as a routine traffic stop in a parking lot near McComas Hall, a gym and sports building, said Mark Owczarski, director of news and information.

During the stop, a gunman walked up to the officer and shot and killed him, officials said during a news conference on Thursday. The gunman was not the person involved in the traffic stop.

For several tense hours, police searched for the gunman. The university announced about 4:30 p.m. that there was “no longer an active threat” on campus.

Earlier in the day, witnesses reported seeing the gunman running toward a different parking lot, called the Cage, near Duck Pond Drive. At that parking lot, a man was found, also dead of a gunshot wound. Officials would not comment on whether the second person found dead was the man who shot the police officer.

Police did not identify the officer but said he was a four-year veteran of the Virginia Tech police department. State police were still investigating whether he had been specifically targeted.

“The second is an unknown male subject who was found deceased in a parking lot near the Duck Pond,” the university said in a statement. “A weapon has been recovered at the location of the second individual. Reports of any additional shots being fired or any additional victims are unfounded.”

An image posted online by a reporter from The Roanoke Times, Lerone Graham, showed a cordoned-off area and white sheet covering a body in the middle of a narrow road.

Lerone Graham via Twitter

All Montgomery County schools are on lockdown as #VaTech shooting investigation continues. MikeGangloffRT

MikeGangloffRT

Ed Falco, the director of creative writing at Virginia Tech, was one of 12 professors locked in his office at Shanks Hall on Thursday afternoon.

Mr. Falco, who was off campus during the 2007 shooting, said he had been at home Thursday when he received an alert on the campus message system. He said that because previous alerts had been prompted by backfiring trucks and other false alarms, he decided to come to school for an appointment. “I figured this would be the same thing, and came to campus anyway,” he said. “I’m fine, but along with everyone else, this brings back very bad memories and bad associations. That this is actually happening is unbelievable.”

Mr. Falco said there was a state trooper parked outside the building and that the police made sure that everyone inside was fine.

A bulletin described the gunman, traveling on foot in the direction of a recreational sports building, as a white male, wearing gray sweatpants, gray hat with a neon-green brim, a maroon hoodie and a backpack.

Earlier in the day, a student publication, The Collegiate Times, reported that witnesses saw a man matching the suspect’s description.

The Virginia State Police have been asked to take the lead in the case, Mr. Owczarski said.

On April 16, 2007, a student, Seung-Hui Cho, shot and killed 32 people before killing himself on Virginia Tech’s quiet campus, five hours south of Washington in the western mountains of Virginia. It was the country’s deadliest shooting, prompting a national outcry and eventually leading to changes in legislation that closed loopholes that had allowed Mr. Cho to buy guns even though he had been committed to a mental hospital.

A university spokesman described the warning system that was activated on campus during and after the shooting in a video interview by WDBJ television in Roanoke, Va.. The university was fined by the Department of Education earlier this year for waiting too long to notify students after the 2007 attack. According to reports, the campus police chief and other university officials were in Washington on Thursday to appeal a $55,000 fine related to this delay.

Students in Torgersen Hall, a classroom building with large study areas, posted images and video said to depict heavily armed police officers secured the building and briefed those assembled.

Thursday was the last day of a reading period before finals at Virginia Tech and there were no classes scheduled. The university said exams would be postponed.

Exams scheduled for tomorrow have been postponed, according to Virginia Tech Collegiate Times

CollegiateTimes

Hayley Bance, a freshman animal science student from Richmond, Va., said she was sitting with some friends in a dining area of Squires Student Center when the building suddenly became a flurry of police activity.

“It was unreal. It just didn’t feel like it was happening on this campus,” Ms. Bance said. “Then we were told to move away from the windows and were taken upstairs. We saw these two police officers with huge guns. Then it started to feel real.”

Zach Crizer, Michelle Sutherland, Lindsey Brookbank and Liana Bayne contributed reporting from Blacksburg, Va.