TOKYO — Shinzo Abe’s past year as prime minister has concentrated chiefly on reviving Japan’s long-ailing economy. Yet in Mr. Abe’s mind, the country’s newfound economic prowess is a means to an end: to build a more powerful, assertive Japan, complete with a full-fledged military, as well as pride in its World War II-era past.

That larger agenda, which helped cut short Mr. Abe’s first stint in office in 2006-7, has again come to the forefront in recent weeks, culminating in his year-end visit Thursday to the Yasukuni Shrine, which honors the nation’s war dead, including several war criminals who were executed after Japan’s defeat. Past visits by Japanese politicians have angered China and South Korea, both of which suffered greatly under Japan’s empire-building efforts in the 20th century.

The latest visit set off swift rebukes from officials in Beijing and Seoul, who accused Mr. Abe of trying to obscure imperial Japan’s atrocities. And in a rare criticism of a close ally, the new American ambassador to Japan, Caroline Kennedy, also expressed disappointment with Mr. Abe’s government.

Mr. Abe has shown, however, that he is willing to take on big political risks to steer the country away from its postwar pacifism. Last month, he ignored blistering criticism from political opponents as well as the news media and steamrollered through Parliament a law that would tighten government control over state secrets. The law was presented by the government as a mechanism to aid in the sharing of military intelligence with allies, and create an American-style National Security Council.