TOKYO (AP) - A tense Japan prepared Tuesday for a rare and controversial state funeral for assassinated former Prime Minister Shinzo Abe, the longest-serving leader in his nation's modern history and one of the most divisive.

Tokyo was under maximum security, with angry protests opposing the funeral planned around the capital and nation. Hours before the ceremony began, dozens of people carrying bouquets of flowers queued at public flower-laying stands at nearby Kudanzaka park.

Thousands of uniformed police mobilized around the Budokan hall, where the funeral is being held, and at major train stations. Roads around the venue are closed throughout the day, and coin lockers at main stations were sealed for security. World leaders, including U.S. Vice President Kamala Harris, were in town for the funeral.

Opponents of the state-sponsored funeral, which has its roots in prewar imperial ceremonies, say taxpayers' money should be spent on more meaningful causes, such as addressing widening economic disparities caused by Abe's policies.

Prime Minister Fumio Kishida has been criticized for forcing through the costly event to honor his mentor, Abe, who was assassinated in July. There has also been a widening controversy about Abe's and the governing party's decades-long close ties with the ultra-conservative Unification Church, accused of raking in huge donations by brainwashing adherents. Abe's alleged assassin reportedly told police he killed the politician because of his links to the church; he said his mother ruined his life by giving away the family's money to the church.

Kishida says the longest-serving leader in Japan's modern political history deserves a state funeral. The government also maintains that the ceremony is not meant to force anyone to honor Abe. Most of the nation's 47 prefectural governments, however, plan to fly national flags at half-staff and observe a moment of silence.

Opponents say Kishida's one-sided decision, which was made without parliamentary approval, was undemocratic, and a reminder of how prewar imperialist governments used state funerals to fan nationalism. The prewar funeral law was abolished after World War II. The only postwar state funeral for a political leader, for Shigeru Yoshida in 1967, also faced similar criticism.

“Spending our valuable tax money on a state funeral with no legal basis is an act that tramples on the constitution,” organizer Takakage Fujita said at a protest Monday.

About 1.7 billion yen ($11.8 million) is needed for the venue, security, transportation and accommodation for the guests, the government said.

A group of lawyers has filed a number of lawsuits in courts around the country to try to stop the funeral. An elderly man last week set himself on fire near the prime minister's office in an apparent protest of the funeral.

In what some see as an attempt to further justify the honor for Abe, Kishida has launched a series of meetings with visiting foreign leaders in what he calls “funeral diplomacy.” The talks are meant to strengthen ties as Japan faces regional and global challenges, including threats from China, Russia and North Korea. He was to meet about 40 foreign leaders through Wednesday. No Group of Seven leaders are attending.

Kishida met about 10 dignitaries Monday, including Harris, Vietnamese President Nguyen Xuan Phuc and Philippine Vice President Sara Duterte. He will meet with his Australian and Indian counterparts separately and host a reception Tuesday.

About 4,300 people, including Japanese lawmakers and foreign and local dignitaries, are attending the funeral.

Japanese troops will line the streets around the venue, and 20 of them will act as honor guards outside of Abe's home as his family leaves for the funeral. There will then be a 19-volley salute.

The ceremony will start when Abe's widow, Akie Abe, enters the hall carrying an urn containing her husband's ashes, placed in a wooden box and wrapped in white cloth. The former leader was cremated after a private funeral at a Tokyo temple days after his death.

Government, parliamentary and judicial representatives, including Kishida, will make condolence speeches, followed by Akie Abe.

The main opposition Constitutional Democratic Party of Japan and the Japanese Communist Party are boycotting the funeral, along with others.

Abe's opponents recall his attempts to whitewash Japan's wartime atrocities, his push for more military spending, his reactionary view of gender roles and a leadership seen as autocratic and supportive of cronyism.

Protests of the funeral have increased as more details emerged about Abe's and LDP lawmakers' connection to the Unification Church. The South Korea-based church has built close ties with LDP lawmakers over shared interests in conservative causes.

“The fact that the close ties between the LDP and the Unification Church may have interfered with policymaking processes is seen by the Japanese people as a greater threat to democracy than Abe's assassination,” wrote Hosei University political science professor Jiro Yamaguchi in a recent article.

Abe's grandfather, former Prime Minister Nobusuke Kishi, helped the church take root in Japan and is now seen as a key figure in the scandal. Opponents say holding a state funeral for Abe is equivalent to an endorsement of ruling party ties to the Unification Church.