A virus caused the U.S. Customs computer system used to process passengers arriving on international flights to shut down for several hours Thursday, leaving long lines of impatient travelers, officials said.

Homeland Security spokesman Russ Knocke (search) said the virus impacted computer systems at a number of airports, including those in New York, San Francisco, Miami, Los Angeles, Houston, Dallas and Laredo, Texas.

The worst delays appeared to be at Miami International Airport (search), where as many as 2,000 people waited to clear immigration, airport spokesman Marc Henderson said.

At New York's airports, customs officials processed passengers by hand during the shutdown. In Los Angeles, they used backup computer systems to keep passengers moving.

The computer problem originated in database systems located in Virginia and lasted from around 6 p.m. until about 11:30 p.m., said Zachary Mann, spokesman for U.S. Customs and Border Protection in southern Florida.

"Unfortunately with technology you have periods where things happen," he said.

Knocke declined to provide further details on where the computer virus originated.

Long lines formed at the immigration and passport control section of the Miami airport, which in 2004 was ranked third in the nation in international passenger flow. The passengers had not been permitted to leave the area until they were checked and cleared by immigration, Henderson said.

Mike Fleming, spokesman for U.S. Customs and Border Protection (search) in Los Angeles, said the computer problem at Los Angeles International Airport only lasted for about an hour and a half.

"It was during a light time of travel for international passengers at LAX," Fleming said. "All systems have been restored to full capacity."