Pope Francis expressed his spiritual closeness to the victims and all those affected by a mass shooting that killed 14 people and injured another 25 at a historic university in Prague, Czech Republic.

The pope was "deeply saddened to learn of the loss of life and injuries caused by the shooting at Charles University in Prague," said a telegram sent on the pope's behalf by Cardinal Pietro Parolin, Vatican secretary of state.

A gunman, believed by Czech authorities to have been a 24-year-old student at the university, opened fire on people on the university campus in central Prague at about 3 p.m. local time Dec. 21. Videos on social media showed students barricading themselves in classrooms and even climbing onto ledges of academic buildings to seek safety.

Czech police believe the shooter died by suicide.

Pope Francis "expresses his spiritual closeness to all affected by this tragedy," said the telegram, which was published Dec. 22.

"Entrusting those who have died to the loving mercy of almighty God, His Holiness invokes divine strength and consolation upon their grieving families and friends, and he assures the nation of his prayers at this difficult time," it read.

In a statement released Dec. 21, Archbishop Jan Graubner of Prague expressed his "sincere condolences and deep regret to the bereaved families of all the victims" and assured them of his closeness.

"I pray for the dead, their families, loved ones and friends, and for the recovery of all the injured," he said. "I ask the Lord to bring comfort to all in this pre-Christmas season and help them to overcome their pain and grief."

Charles University is the oldest and largest university in the Czech Republic. Established by a papal bull in 1347, it is one of the oldest existing universities in continuous operation in the world.