Plot
Viktor Navorski, a traveler from Krakozhia, arrives at New York City's John F. Kennedy International Airport and learns that a coup d'état has occurred in his country while he was in the air. The United States does not recognize Krakozhia's new government, rendering Viktor's passport invalid and leaving him unable to either enter the United States or return to Krakozhia. U.S. Customs and Border Protection seizes his passport and return ticket pending resolution of the issue, leaving him stranded at the airport with only his luggage and a Planters peanut can in his possession.
Frank Dixon, the Acting Field Commissioner of the airport, instructs Viktor to stay in the transit lounge until the issue is resolved, but he becomes determined to make Viktor someone else's problem. Viktor finds a gate under renovation and makes it his home. Being considered for a promotion, Dixon becomes increasingly obsessed with getting rid of him.
Viktor has repeated encounters with Gupta Rajan, a grumpy elderly janitor, with whom he slowly forms a bond. He also befriends Joe Mulroy, a baggage handler. Enrique Cruz, a food service truck driver, provides Viktor with free meals in exchange for helping him woo Dolores Torres, an immigration officer whom Viktor has befriended. With Viktor's help, Enrique eventually marries Dolores.
Viktor shows skill at construction work when he remodels a wall in a terminal undergoing renovation. The airport contractors assume he is an employee and pay him under the table. He also begins a relationship with Amelia, a flight attendant who is also entangled with a married government official.
During a visit from his superiors, Dixon enlists Viktor's help in communicating with a Russian man who is attempting to bring medicine home to his dying father. Dixon is determined to confiscate the medicine because of a paperwork issue, which Viktor helps the man circumvent. This humiliates Dixon, who threatens Viktor that he will never let him enter the United States. Viktor becomes a legend amongst the terminal employees for helping the man and standing up to Dixon.
Dixon detains Amelia and interrogates her about Viktor. Amelia, who realizes that Viktor has not been entirely truthful, confronts him at his makeshift home, where he shows her that the Planters peanut can contains a copy of the "A Great Day in Harlem" photograph. His late father was a jazz enthusiast who had vowed to collect the autographs of all 57 musicians depicted in the photo. He died needing only the autograph of tenor saxophonist Benny Golson, and Viktor has come to New York to obtain it. After hearing the story, Amelia kisses Viktor.
Nine months after having arrived, Viktor learns that the war in Krakozhia has ended. Amelia reveals that her married boyfriend has secured Viktor a one-day emergency visa so he can fulfill his dream, but she has also rekindled the relationship.
When he presents the emergency visa at customs, Viktor is informed by Dolores that Dixon must sign it. However, as Viktor's passport is valid again, Dixon is determined to deport him to Krakozhia. He warns Viktor that if he does not go home, he will prosecute his friends at the airport for their illegal activities, most seriously by deporting Gupta to India to face a charge of assaulting a corrupt police officer. Viktor agrees to return home, but Gupta delays the plane by running in front of it, thus being taken into custody.
Emboldened by his friend's actions, Viktor decides to leave the airport. Dixon orders his officers to intercept him at the exit, but in defiance of Dixon, they let Viktor leave. Dixon reaches the taxi stand moments after Viktor has left, but he returns to handle the incoming travelers rather than engage in pursuit. Viktor arrives at the hotel where Golson is performing and collects the last autograph, then takes a taxi back to the airport to go home.