Osaka voters rejected a referendum proposal Sunday to merge the city into five semi-autonomous wards, dealing a crippling blow to Mayor Toru Hashimoto.

“I will continue on as mayor until my term expires, but I will retire from politics after that,” Hashimoto said at a news conference Sunday night, reiterating his earlier promise to retire from politics when his current term expires in December.

The turnout rate was 66.83 percent, 5.91 points higher than that of Osaka’s double gubernatorial and mayoral elections in 2011. But the margin of victory for the merger opponents was razor thin — just over 10,000 votes — with the final tally 705,585 votes against versus 694,844 for it.

The result is expected to create political headaches between Prime Minister Shinzo Abe, whose government indicated its support for the merger last week, and members of his Liberal Democratic Party, especially in the Osaka chapter, who opposed it.

Abe was trying to gain the cooperation of Ishin no To (Japan Innovation Party), a national party Hashimoto jointly set up with Lower House member Kenji Eda, to propose a national referendum to revise the postwar Constitution.

Ishin no To was willing to cooperate with Abe because it advocates constitutional revision to consolidate prefectural governments and give them more autonomy. But Sunday’s referendum judgment will considerably reduce Ishin no To’s clout in the Diet and might make it more difficult for the party to win more seats in the House of Councilors election scheduled for next year.

Following Hashimoto’s announcement that he would not seek re-election as mayor when his term expires, Eda said he would step down as party leader, blaming the loss on his lack of leadership. Yorihisa Matsuno, who serves as the party’s secretary general, also announced his resignation.

But Eda told reporters that he was convinced the political world had not heard the last of Hashimoto.

“He’s the kind of politician who only comes along once every 20 or 30 years,” Eda said. “I’m sure he’ll be back.”

Though the slim margin of the victory was a surprise, the result of the referendum was not unexpected. Since April, most local media polls had consistently shown more residents opposed the merger than supported it. A large portion of residents consistently said they did not understand why the merger was necessary. Others, especially younger and older women, feared a decline in child care, education and social welfare services for the elderly if a merger went through.

Sunday’s loss ends a five-year quest by Hashimoto and his local party, Osaka Ishin no Kai (One Osaka), to merge the city’s 24 wards, which are all headed by bureaucratic appointees, into five semi-autonomous districts run by elected leaders and assemblies.

Hashimoto was elected governor of Osaka Prefecture in 2008, promising to reform local government, and he later announced the formation of local political group Osaka Ishin to help him carry out his goal of an eventual “all-Kansai” semi-autonomous regional block system.

The first step toward that ultimate goal would be the integration of Osaka Prefecture. Opposition from neighboring cities, however, especially Sakai, forced Hashimoto’s local party to change the plan to merging only the 24 wards of the city of Osaka.

But it faced stiff opposition from local chapters of all the established parties, which banded together in unprecedented fashion to halt the merger.

During the referendum campaign, Osaka LDP members teamed up and publicly appeared with rivals from not only the main opposition Democratic Party of Japan but also, in a move that surprised and angered many at LDP central headquarters, the Japanese Communist Party.

LDP ruling coalition ally Komeito, whose support organization Soka Gakkai includes 150,000 of Osaka’s 2.1 million voters, also campaigned against the merger, despite the fact that, due to pressure from Komeito officials in Tokyo, the local chapter had voted to hold the referendum. The lay Buddhist Soka Gakkai took no official position in the referendum, telling its members to vote as they pleased.

While another referendum on the issue is theoretically possible, Hashimoto had said this was the one and only time it would be held.

With next year’s Upper House elections looming, Abe hopes Ishin no To will increase its presence in the chamber, where it currently holds 11 seats, securing enough to form a two-thirds majority with the LDP, which has 114 seats. That would then give parties supporting constitutional revision a supermajority in both houses of the Diet.

However, with Sunday’s defeat, the exit — at least for now — of Hashimoto from the political stage and the resignations of Eda and Matsuno, Ishin no To, which had made the merger a key plank in its campaign manifesto, faces an uncertain future as a political party.