Pope Paul VI, whose 15-years reign as spiritual leader of the world's 600 million Roman Catholics spanned an era of innovation and conflict, died yesterday after suffering a heart attack at his summer residence at Castel Gandolfo, south of Rome.

The frail and ailing 80-year-old pontiff was stricken with what initially was described as a mild heart attack as he listened to a Mass being said by his personal secretary in the papal apartment. Less than four hours later, at 9:40 p.m. Rome time (3:40 p.m. EDT), he died. Although the Pope had been confined to his bed Saturday with another of the many infirmities that had hampered his activities in recent years, the suddenness of his death yesterday came as a surprise even to close associates.

"I invite you to pray so that God may soon restore the Holy Father to the church and the world," Vatican spokesman Don Pierfranco Pastore had said when he announced the news of the heart attack. A few hours later he broke into sobs as he told reporters gathered at the Vatican the despite intense medical efforts, the pope had died.

Although no details of the mourning period and funeral have been announced by the Vatican, it is expected that Pope Paul's body will lie in state in St. Peter's Basilica in Rome for several days before the funeral is held.

Then, no sooner than 15 days after the pope's death, according to church protocol, cardinals of the church will gather in Rome to secretly choose a new pope.

News of the pontiff's death spread rapidly through St. Peter's Square where thousands of Roman Catholics had gathered to wait for new of his condition. Some wept while others knelt and prayed.

In Castel Gandolfo, the city lights were turned off in a sign of mourning and the church bells sounded death knell. The pope's Swiss Guards closed the doors to the castle where top church dignitaries had flocked at the news of the pope's illness.

Among the first to go to Pope Paul's bedside was Jean Cardinal Villot, the Vatican's secretary of state, who takes over temporary administration of the church until a successor is chosen. Villot had been staying at Castel Gandolfo because of the pope's frail health.

For years the Pope had been suffering from an extremely painful form of arthrosis fusion of the joints that in recent months had left him virtually immobile. Over the last year the pope who has traveled so widely in the past rarely left e Vatican. The number of his audiences had been cut almost in half and at Easter time he took to his bed for several days with a severe case of influenza bronchitis.

Although his health had been described by some Vatican insiders as a "poor, iron constitution" that could have kept him alive for ears, in recent months the pope had spoken frequently in public o his impending death. The most recent occasion was Tuesday when he said that death "for us cannot be far away."

In recent weeks the pope had kept up many of his activities, speaking up forcefully in against Italy's new abortion law and the trials of Soviet dissidents and meeting with top-level visitors. They included former West German chancellor Willy Brandt and two fellow octogenarians, Lillian Carter and Italy's new president, Sandro Pertini, who Tuesday was the pope's last official visitor.

The popehad also displayed considerably energy in recent moments of crisis. Late last year when terrorists hijacked a West German plan he offered himself as a hostage in exchange for the passengers. On may 9, he summoned up his strength and left the Vatican to officiate at a state funeral for assassinated former Italian prime minister Aldo Moro.

When the pope was stricken yesterday, he immediately was given the last sacramental rites. It was reported that shortly after the pontiff was stricken, Vatican officials made an inspection of the Vatican crypts where the popes are buried.

Informed sources said last night that the Vatican was planning to bring the Pope's body back to Rome today and have the body lie in state at St. Peter's until the funeral.

A memorial mass is scheduled for tonight. Many foreign heads of state and dignitaries a expected to come to Rome to honor the memory of the Roman Catholic Church's 262nd pope.

The death of the spiritual leader of the world's 600 million Roman Catholics brings to an end a 15-year reign of a man who has led the church in a time of transition and who has therefore borne the brunt of criticism of many liberals and conservatives alike.

Elected on June 21, 1963, and installel nine days later, Pope Paul made history partly because of his unprecedented travels to all the continents of the earth.

Following in the footsteps of the charismatic John XXIII, Pope Paul Vi picked up the reins of the Roman Catholic church at a time when dissent and a demand for dialogue were being stimulated by the reforms of the second Vatican Council. He quickly found himself forced into the role of a mediator between those in the Roman Catholic Church who wanted change and those who opposed it.

Paul left no obvious successor. So when the College of Cardinals meets in Rome later this month and Cardinal Villot breaks Pope Paul's ring and seals in a final tribute, it is likely that an entirely new era may have begun for the Roman Catholic Church.