Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

A beloved school crossing guard in Kansas died after he was hit by a car while saving two young children, the school said in a Facebook post.

Bob Nill, 88, was helping children cross the street just before 8 a.m. Tuesday near Christ The King Catholic School in Kansas City when he saw a car approaching. Nill stopped two children from stepping off the sidewalk so they would not be hit by the vehicle.

Nill was then struck by the vehicle. He was taken to the hospital in critical condition where he later died.

"All the children of the school are safe and we prayed a rosary immediately as a school for Mr. Nill," the school said in its Facebook post.

In a second post, the school called Nill a "hero" for saving the two children.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

A crossing guard was struck and killed while directing traffic outside a school in Kansas City, Kansas, on Feb. 18, 2020. KSHB

"He stopped two of our students from crossing the road as the car approached," it read, adding in a third post: "Thank you for protecting the children of CTK!"

Nill joined the Unified Government of Wyandotte County/Kansas City, Kansas, as a crossing guard in 2015 after retiring from a previous job, spokesman said Dave Reno said.

The Unified Government said in a press release that it was "deeply saddened" over his death.

"Unified Government staff extends their heartfelt thoughts and prayers to the employee's family, friends and all those affected by this tragedy," a statement read.

Cathy Fithian, principal of Christ The King Catholic School, told NBC affiliate KSHB in Kansas City, Missouri, that she thinks things would have turned tragic for her two students, a 7-year-old and 11-year-old, if Nill had not stepped in.

"... we are thankful, we feel very blessed to have had him in our lives for five years," she said. "We just pray for his family at this time."

Kansas City Mayor David Alvey thanked Nill.

"I offer our deepest sympathies to the family of Mr. Nill. To Mr. Nill, our heartfelt gratitude for your selfless act in protecting our children," he said in a statement.

Police said the driver of the car was taken to the hospital for injuries. Authorities told KSHB that the driver is cooperating with an investigation into the collision.