Updated

Cardinal Franciszek Macharski, a popular Polish prelate who served for many years as archbishop of Krakow, inheriting a position opened by the election of Pope John Paul II, has died. He was 89 years old.

The death of Macharski, who had been close to John Paul, comes five days after Pope Francis stopped by his hospital in Krakow to pray for him during a visit last week to Poland.

The death was reported Tuesday by the Rev. Piotr Studnicki, a church spokesman.

Macharski became Krakow archbishop in 1978, replacing Karol Wojtyla, who became the first Polish pope that year. Macharski served in that position until 2005, which was also the year that John Paul died after a 27-year pontificate.

Macharski was succeeded by Cardinal Stanislaw Dziwisz, John Paul's longtime aide.