Officials said service was restored after about two hours but travelers then faced long waits to be processed.
A computer system used to usher arriving passengers through customs at airports suffered a nationwide failure for a couple of hours on Friday, causing ripples of delays and leaving frustrated travelers waiting hours to be processed.
The failure was reported around 4:30 p.m., and by about 6:30 p.m., airports said the system had been restored.
It was not immediately clear what had caused the disruption, but the United States Customs and Border Protection said on Twitter that there was no indication that what happened was “malicious in nature.”
Passengers from coast to coast complained on social media about waiting in long lines after extended trips and expressed worry about missing connecting flights. During the shutdown, which affected self-service kiosks, customs officers processed passengers manually, one by one.
Gordon Loesch, a reporter and anchor at WPXI in Pittsburgh, said on Twitter that he had been waiting on the tarmac in Chicago for about 30 minutes and that the pilot had announced that passengers could be waiting on the plane for a couple of hours because of the system failure.
“Passengers are getting concerned about missing connections and booking rooms for the night,” Mr. Loesch said on Twitter.
At the international arrivals area of Terminal 8 at Kennedy Airport on Friday night, travelers described a hectic scene: waits of up to three hours, lines that curled around each other and an immense sense of frustration.
“There was no organization,” said Max Ludlow, who flew in from London. “You’d horseshoe around, and then realize you were on another line, and some had cut. People got mad.”
Connie Concetto, who arrived from Antigua, said she was thankful she had previously downloaded the mobile application that swiftly takes travelers through customs. Her 20-minute wait compared with travelers who filled the cavernous customs section for hours.
She said custom agents were sympathetic: “They brought out a whole crate of water bottles for everyone. And people definitely took them up on it.”
Ninis Samuel of Chicago said in a phone interview that he had landed at Kennedy Airport at 3:45 p.m. from Copenhagen.
“Nothing’s moving,” he said. “I’m standing here with the crew. People are massed here like cattle.”
Of the crowd, he said, “To my horizon line, you wouldn’t believe it,” adding, “I’m sure there are over 1,000 people here right now waiting in line.”
Rosemary Behan arrived at Seattle-Tacoma International Airport at 11:25 a.m. local time after traveling for more than 24 hours from Mongolia to Seoul to Seattle.
“We were stuck for almost three hours,” Ms. Behan said. “Elderly people were sitting on the floor and no water was offered. It was like a third world country.”
Ms. Behan said when the system came back online around 2:45 p.m., people were relieved and rushed to get processed.
Everyone wanted to get through before it went down again, she said.