Updated

A generous stranger bought a ticket for an Illinois soldier who was waiting at a Texas airport hoping to catch a flight home on Memorial Day weekend.

Keaton Tilson, 19, a U.S. Army mechanic stationed in Fort Hood, Texas, was given permission on Thursday to go home to Granite City, Ill., for the Memorial Day weekend, Fox 2 Now reported.

Tilson had not been home since Christmas.

Tilson went to Dallas-Fort Worth International Airport, bought a standby ticket and hoped to get a last-minute seat on a flight. The teenager waited at the airport for two days.

ILLINOIS EX-CONGRESSIONAL CANDIDATE CHARGED WITH DUI, HITTING OFFICER

“It looked good at first,” Tilson’s mother, Jennifer, told CBS News. “There were open seats. Then something happened, and he kept missing flights and missing flights.”

Tilson asked a gate agent if there was anything else he could do but the agent told the soldier that it did not look promising.

A few hours later, Tilson called his mother to let her know that he may not make it home.

“I had to keep quiet because he was surprising his siblings,” Jennifer said. “I didn’t want to tell them in case he didn’t come.”

Not long after his call, a man asked the gate agent if Tilson could take his ticket for a flight that was about to board.

The stranger, Josh Rainey of Glendale, Mo., was told he could not switch tickets right before boarding. Rainey called his wife for guidance and then returned to the gate agent to buy the soldier a $375 ticket home.

REPORT: ILLINOIS OFFICE HAD CONTEST TO CLOSE FAMILY CASES

“We (Rainey and his wife) agreed both that it was the right thing to do to go back and buy the ticket,” Rainey told Fox 2 Now.

Later on the plane, the soldier hugged Rainey before taking his seat. While speaking, Tilson learned that Rainey lived nearby and that they had a mutual friend. Using that information, Jennifer was able to obtain Rainey’s information and formally thank him.

“I told him how grateful we were,” Jennifer said. “He just knew it was the right thing to do. His dad was in the military for 30 years.”

Rainey said the teenager’s hug was the best thank you he could receive.

“That was worth every penny,” Rainey said.