Inspired from true life, this upbeat romantic comedy revolves around Krakozhian traveler Viktor Navorski (Tom Hanks), who arrives at New York's John F. Kennedy International Airport with many dreams and hopes, only to find that his passport is suddenly no longer valid due to the outbreak of a civil war in Krakozhia, his homeland.
As a result, the United States no longer recognizes Krakozhia as a sovereign nation, and he is not permitted to either enter the country or return home as he is now stateless. Unable to communicate in proper English, US Customs and Border Protection seizes his passport and airline ticket.
With no other choice, he settles in at the terminal with only his luggage and a Planters peanut can, much to the frustration of Frank Dixon (Stanley Tucci), the senior US Customs official for the airport. Dixon is being considered for a promotion and becomes obsessed with getting rid of Viktor.
Meanwhile, Viktor befriends and helps airport employees and travelers. Among them, a flight attendant named Amelia Warren (Catherine Zeta-Jones), whom he sees periodically and tries to woo, presenting himself as a building contractor who is frequently traveling. Victor had been hired by an airport contractor and paid under the table after he impulsively remodeled a wall at a gate that was scheduled for future renovation.
One day, Dixon pulls Amelia aside and questions whether she knows Viktor's true situation or what is in his Planters can. Amelia confronts Viktor at his makeshift home, where he shows her that the peanut can contains a copy of the "A Great Day in Harlem" photograph.
His late father was a jazz enthusiast who had discovered the famous portrait in a Hungarian newspaper in 1958, and vowed to collect the autographs of all 57 of the jazz musicians featured on it. He died before he could get the last one, from tenor saxophonist Benny Golson. Viktor has come to New York to do so. After hearing the story, Amelia kisses Viktor.
After nine months, his friends wake Viktor with the news that the war in Krakozhia has ended. Amelia also asked her "friend" — actually a married government official with whom she had been having an affair — to get Viktor a one-day emergency visa to fulfill his dream, but Viktor is disappointed to learn she has renewed her relationship with the man during this process.
Moreover, Viktor finds out that Dixon must sign the visa. Seizing the opportunity, Dixon threatens to cause trouble for Viktor's friends, most seriously by deporting Gupta back to India, where he is wanted for assaulting a corrupt police officer back in 1979. Unwilling to let this happen, Viktor finally agrees to go home to Krakozhia.
When Gupta learns of this, however, he runs in front of the plane to Krakozhia as it taxies to the terminal, resulting in his deportation, effectively taking the burden off Viktor. The delay gives Viktor enough time to go into the city. Dixon, watching Viktor leave the airport, decides not to pursue him.
Viktor arrives in New York at the hotel where Benny Golson is performing and finally collects the last autograph. Then he gets in a taxi, telling the driver, "I am going home.".