(CNN) -- Time was running out, and Mark Dickinson wasn't sure whether he'd get to see his dying 2-year-old grandson one last time. A long line at Los Angeles International Airport's security checkpoint had kept him from getting to his gate on time.

His grandson Caden would be taken off life support in a matter of hours in Denver, Colorado, with or without his grandfather's presence, according to CNN affiliate KABC.

"I was kind of panicking because I was running late, and I really thought I wasn't going to make the flight," Dickinson told KABC.

That's when a pilot from Southwest Airlines stepped up and held the flight at the gate until Dickinson arrived. The pilot was standing by the jetway waiting for him when Dickinson arrived in socks, so rushed that he just grabbed his shoes at security and ran through the terminal.

"I told him, 'Thank you so much. I can't tell you how much I appreciated that.' And he said, 'No problem. They can't leave without me anyway,' " Dickinson told KABC.

Authorities say Dickinson's grandson, Caden Rodgers, suffered a head injury after his mother's boyfriend threw him across the room. The boyfriend reportedly told police he was drunk and high on marijuana at the time. The child later died and the boyfriend has been charged with first-degree murder, according to the Aurora Sentinel.

Dickinson's wife had called Southwest and asked them to hold the plane. After the flight, Dickinson said, he wanted to thank the pilot again for his serious display of empathy but didn't get the chance. Dickinson made it to Colorado in time to say goodbye to his grandson.

"I would just tell him that I can't tell him how grateful I am that he did that for me," he said.

Most airlines would punish any staff member who holds up a flight, according to consumer advocate Christopher Elliott, who broke the story of the compassionate pilot on his blog. However, a Southwest spokeswoman said the pilot's actions were exemplary.

"You can't hold a plane for every late customer, but I think we would all agree that these were extenuating circumstances and the pilot absolutely made the right decision," Southwest spokeswoman Marilee McInnis said. "I don't think you could ask for a better example of great service for our customers."

Though the airline has identified the pilot who held the plane for Dickinson, the pilot has asked that his name not be released to the public.

"As you're reading the story, you absolutely get tears in your eyes and just an overwhelming sense of pride that our pilot took such an action," McInnis said. "It really makes you proud to work for Southwest."