Edward Cardinal Egan, archbishop of New York from 2000 to 2009, has died at age 82, the Roman Catholic Archdiocese of New York said Thursday.

Egan was pronounced dead at a New York hospital on Thursday afternoon. The cause of death was cardiac arrest, the archdiocese said.

“Thank God he had a peaceful death, passing away right after lunch today, with the prayers and  sacraments of his loyal priest secretary, Father Douglas Crawford, in his residence at the Chapel of the Sacred Hearts of Jesus and Mary,” Timothy Cardinal Dolan, the current Archbishop of New York and Egan’s successor, said in a statement.

Egan was born April 2, 1932 in Oak Park, Illinois. He was consecrated a bishop in 1985, and was appointed archbishop of New York in 2000 by Pope John Paul II.

Egan was archbishop during the September 11 terror attacks during which he anointed the dead at a lower Manhattan hospital and presided over many funerals for victims.

He was a scholar of church law and spoke Latin fluently. John Paul chose him to help with the massive job of reviewing a revised canon law code for the global church.

Egan was elevated to the College of Cardinals in 2001 and participated in the 2005 and 2013 conclaves that elected Pope Benedict XVI and Pope Francis. He also welcomed Pope Benedict to New York during the pontiff's visit to Manhattan, a vist that included a Mass at Yankee Stadium. 

Egan retired as archbishop in 2009 at the age of 77.

The Associated Press contributed to this report.