An 88-year-old crossing guard died tragically this week when he was hit by a car while saving two children from being struck by the vehicle. Bob Nill of Kansas City, Kansas, was affectionately known to the community as "Mr. Bob."

Nill was working his regular shift Tuesday morning when the incident occurred in front of Christ the King Catholic School. Just before school started, Nill was struck by a black sedan. He was transported to a local hospital in critical condition and later died of his injuries, the Kansas City Police Department said.

In a series of heartfelt Facebook posts, Christ the King Catholic School thanked Hill for "protecting the children of CTK" and saving two children who were attempting to cross the road when the accident occurred.

Get Breaking News Delivered to Your Inbox

"Our hearts are heavy as we inform you of [Nill]'s passing. Please continue to keep Mr. Nill and his family in your prayers as well as the students, parents, and teachers who witnessed today's accident," the school said. "Also know that Mr. Nill is a hero. He stopped two of our students from crossing the road as the car approached."

Bob Nill, 88, died Tuesday while keeping schoolchildren safe. Christ the King Catholic School / Facebook

Principal Cathy Fithian told The Kansas City Star that many students had given Nill gifts for Valentine's Day. She said he always put children first.

"He always thought about the kids more than himself," Fithian said. "We just want his family to know what a loving heart he had and the community to know what a blessing he was for our community."

According to the Star, Nill was retired, but had started working as a crossing guard in 2015 to help kids get to school safely.

"Mr. Nill's act of selfless devotion to the children under his care inspires all of us," Kansas City Mayor David Alvey told CBS News. "We are grateful for the goodness that he has given to our community for so many years."

Police said the driver was also transported to the hospital with injuries. The investigation is ongoing.