Keiji Furuya, chairman of the national public safety commission, one of the two ministers who visited Yasukuni Shrine, said it was "only natural as a Japanese" to honour those who had given up their lives for their country. internal affairs and communications minister Yoshitaka Shindo told reporters his visit was a vow to never wage war again.
In Seoul, South Korean President Park Geun-hye said some Japanese politicians were acting in a way that hurts both South Koreans and Japanese and further pushes the two countries' people apart.
In a speech marking South Korea's independence from Japanese colonialism, Park also asked Japanese leaders to act wisely and expressed hopes that next year the two countries will move together toward friendlier ties.
Prime Minister Shinzo Abe did not go to the shrine, but sent a gift through an envoy. His visit to Yasukuni in December drew widespread criticism, including from the US, Japan's most important ally.
Abe signed the gift as head of the ruling Liberal Democratic Party, and not as prime minister, a party official said — a technicality that is important in the long brewing controversy.
The enshrinement of Class-A war criminals, such as wartime Prime Minister Hideki Tojo, among the 2.5 million dead honoured at Yasukuni Shrine makes the visits a target of condemnation from China and South Korea, which suffered from Japan's aggression and see the shrine as a symbol of brutality.
Dozens of lawmakers from various parties also visited the shrine, wearing dark suits and outfits.
At a ceremony commemorating the end of World War II at a Tokyo hall, attended by thousands of people, Abe said later Friday that the sacrifices of the previous generation brought "peace and prosperity" to Japan.
"We will never forget that," Abe told the crowd, noting that Japan must "humbly face up to history."
Emperor Akihito, whose father surrendered at the end of World War II, also offered prayers at the ceremony on a stage covered with chrysanthemums, flanked by his wife Michiko.
Although extremist nationalists throng Yasukuni, wearing old uniforms and tooting bugle horns, thousands of regular people also go to the shrine on August 15, the anniversary of the end of the war. On that day in 1945, Emperor Hirohito announced the surrender on the radio, the first time the general public had ever heard his voice as he had been considered to be almost divine.
Last month, Abe's Cabinet approved an interpretation of Japan's post-war constitution, which was written by the US, to allow Japanese troops a more active role, including working with the US and other allies, in defensive military activities.
Relations with Asia's neighboris have been strained over such moves and longstanding territorial disputes. But pacifism remains a powerful public sentiment, especially among the elderly.