Emperor Hirohito, declaring that "even now, my heart feels pain," offered prayers to the spirits of 3 million war dead as Japan formally marked the 40th anniversary of the end of World War II.

Seven thousand Japanese, including Prime Minister Yasuhiro Nakasone and leaders of industry, labor and academia, gathered in a flower-decked hall near the Imperial Palace for the hour-long commemorative ceremony.

Silent prayers began at noon, the hour at which the emperor went on national radio on Aug. 15, 1945, to tell the Japanese that their country had lost the war and would surrender to the allies. Because of the time difference between Japan and the United States, the news of the end of the war was received on Aug. 14 in America.

Sirens and bells rang at noon. Flags at government offices and many companies will fly at half-mast, and families of war victims will tend their graves in a show of respect.

The imperial ceremony is held every Aug. 15, officially designated as the "Day to Commemorate the War Dead and Pray for Peace." The arrival of the 40th year has brought no particular surge in remembrance in Japan.

Later today, Nakasone is to visit Yasukuni Shrine in Tokyo as part of his campaign for official Cabinet prayers for the souls of the war dead, which by Shinto belief congregate at the shrine.

Dressed in tails and striped pants, he has called at Yasukuni repeatedly in the past two years, but only in an "unofficial" capacity. Japan's postwar constitution forbids government support for religion.

Today, with members of his Cabinet, Nakasone plans to go again and for the first time declare that he is there as prime minister. About $120 in government funds will be spent to buy flowers for the dead.

It is a symbolic gesture, but one that already has drawn protests from China, the Soviet Union and Japan's major opposition parties. All of them see any move toward official ties with Yasukuni as a step back from full condemnation of the old wartime militarism.

But he will offer a few concessions to these critics, avoiding shrine practices that carry special religious overtones.