TOKYO (AP) — The leadup to former Japanese Prime Minister Shinzo Abe's controversial state funeral could seem like a never-ending exchange of heated words — both for and against. But it was the images of Tuesday’s ceremony that most clearly told the story of a nation still deeply divided over the legacy of perhaps the most polarizing leader in its modern history.

Sections of Tokyo, still on edge after Abe's assassination in July, looked more like a police state than the capital of one of the most stable nations in the world. Twenty thousand police officers and more than 1,000 soldiers crammed the neighborhoods around the massive funeral hall, as thousands of protesters took to the streets.

If Japan is sometimes seen from abroad as a monolith of sorts, a largely uniform middleclass haven of social harmony, Abe’s funeral laid bare some of the messy reality of a divided nation. It's a place where the shadow of World War II — a subject Abe spent much of his career addressing — can still loom as large as the economic and security worries that drive modern elections.

For many of the thousands of public mourners who stood in long lines to take turns bowing and laying small bouquets of flowers beneath photos of Abe in a park near the official ceremonies, the former leader spearheaded a heroic, still unfinished quest to make Japan a “normal country.” He encouraged a sense of national pride in Japan's enormous international contributions instead of focusing on a lingering shame over war-era brutality.

“Former Prime Minister Abe was such a great prominent figure. He brought Japan back to international importance after World War II,” said one of the mourners, Masae Kurokawa, 64.

As he left an offering of flowers, Masayuki Aoki, 70, simply said, "I’m emotionally attached to him.”

But Abe, in life and in death, generated as much anger as admiration.

Large groups of protesters marched through Tokyo, banging drums, shouting and holding signs that urged the funeral be scrapped. Similar anti-Abe rallies happened across the country, a reflection of a deep resentment about honoring a man who critics say repeatedly tried to whitewash Japan’s wartime atrocities, stir nationalist sentiment and engage in high-handed leadership.

"Shinzo Abe has not done a single thing for regular people,” said Kaoru Mano, a Tokyo housewife who was at one protest.

The militaristic tones of the funeral were especially striking in a nation that has operated under a pacifist constitution since 1947 — a constitution Abe wanted to revise to expand the military.

A military band played a funeral dirge and a 19-gun volley was fired as his widow brought Abe's ashes into the funeral hall. Dozens of soldiers in crisp, white dress uniforms carried rifles with bayonets as they stood at attention in front of a huge rampart of tens of thousands of white and yellow chrysanthemums that led up to a large photograph of Abe, draped in black ribbon.

Outside the funeral hall, hundreds of police stood outside office buildings, schools and train stations. The extreme security was linked in part to the continuing shock over Abe’s assassination, in which a suspect reportedly angry about the former leader’s links to a conservative South Korean religious group, the Unification Church, allegedly shot him with a homemade gun while he was giving a campaign speech in western Japan.

In some ways, the split public reactions to the state funeral, which has links to prewar imperial ceremonies that celebrated nationalism, reflect Abe’s career-long push to change the way his nation operates on the world stage.

Adored by many in Washington for his staunch military and diplomatic support, he was loathed by liberals at home and by the Koreas and China for his support of conservative revisionist efforts and his push to end apologies over the war.

Abe saw the country's constitution, which was written largely by occupying Americans, as the product of “victor’s justice” by the West over Japan. That constitution renounces the use of force in international conflicts and limits Japan’s military to self defense, although the country has an advanced modern army, navy and air force.

Abe’s legacy is likely to last in the political party he spent years championing. For all the protesters in the streets Tuesday, the Liberal Democratic Party has ruled almost without interruption since the war’s end; Abe won six national elections during his long years in power.

His LDP acolytes are legion, most prominently the current leader, Fumio Kishida, who has vowed to bolster Japan's military capabilities and carry on many of Abe's policies.

“I hereby announce my pledge to create a Japan, a region and a world that are sustainable, inclusive and where everyone shines on top of the foundation that you built,” Kishida said, addressing Abe in his funeral speech.

___

Foster Klug, AP's news director for Japan, the Koreas, Australia and the South Pacific, has covered Japan since 2005.