Prime Minister Shinzo Abe won the Liberal Democratic Party's presidential election by a comfortable margin on Thursday, setting the stage to become Japan's longest-serving leader and pursue his ambition of amending the pacifist Constitution during his next three-year term.

Abe defeated his sole rival, former Defense Minister Shigeru Ishiba, by securing 553 votes to Ishiba's 254 in the election, which in effect decides Japan's next prime minister because the ruling party and its coalition partner Komeito control majorities in both Diet chambers.

Of 807 total valid votes, Abe won 329 out of ballots cast by Diet members while securing 224 by rank-and-file members. Ishiba attracted 73 from legislators but put up a good fight among ordinary members, garnering 181 votes.

Abe's failure to receive wider support from the rank-and-file members, whose votes are believed to be more reflective of public opinion, suggests there are many who have become frustrated with his long tenure and dissatisfied with a tepid economic recovery, viewed as not benefiting rural areas and smaller companies.

"As we are at a major turning point in history, I am determined to be at the forefront of opening up Japan's tomorrow," Abe said in a press conference after securing his third consecutive term.

Abe also reiterated his long-cherished goal of amending Japan's supreme law, saying, "It's now time to tackle a revision to the Constitution."

Following the victory, Abe said he is planning to reshuffle his Cabinet and the party's leadership lineup after returning home in late September from New York, where he is scheduled to attend the U.N. General Assembly.

He has started making arrangements to revamp his team on Oct. 1, with a plan to keep his close allies, including Finance Minister Taro Aso, Chief Cabinet Secretary Yoshihide Suga and LDP Secretary General Toshihiro Nikai, according to party sources.

"I'd like to appoint the widest possible range of people on a firm foundation," he told the press conference, when asked about the upcoming reshuffle.

The new Cabinet is expected to convene an extraordinary Diet session in late October, government sources said.

Abe said the government is considering submitting a supplementary draft budget for the current fiscal year to the special parliament session to fund recovery efforts from recent natural disasters in the country.

(Ishiba casts his vote)

Abe, who turns 64 on Friday, stepped down as LDP chief and prime minister in 2007 due to health reasons. But he staged a comeback to the top post of the LDP in September 2012 and returned to office later in the year after the party ousted from power the now-defunct Democratic Party of Japan.

He was re-elected party leader unopposed in 2015, when his previous tenure expired. Last year, the LDP decided to extend its term limit for party leaders and enable them to serve for three consecutive three-year terms, up from the previous limit of two consecutive three-year terms.

Abe could surpass Taro Katsura's all-time record of 2,886 days in office during his new term through September 2021, including his stint as prime minister between 2006 and 2007. Katsura served as prime minister in the 1900s and 1910s.

During his nearly six years in office, Abe has sought to beat chronic deflation and achieve sustainable growth through his "Abenomics" policy package and beef up Japan's defense amid a deteriorating security situation due partly to the North Korean nuclear and missile threats.

His administration passed a number of controversial bills, including security legislation on criminal conspiracy and expanding the scope of the Self-Defense Forces' overseas operations.

In the LDP leadership election, Abe and Ishiba needed to secure a majority of the 810 votes that were due to be cast -- 405 by LDP lawmakers and the same number proportioned out to some 1 million rank-and-file party members across the country.

Ishiba secured wider-than-expected support from ordinary members. "The presidential election demonstrated the LDP is not of one color," he told reporters afterward.

With the victory, Abe said the LDP will speed up the pace of preparations to revise the supreme law for the first time since it took effect in 1947 during the U.S.-led postwar occupation.

Abe said he will make efforts to submit constitutional amendment proposals to the next Diet session by coordinating with Komeito, while refraining from specifying a timeline of the process thereafter.

He has said it is vital to clarify the legal status of the SDF in the war-renouncing Article 9 to put an end to arguments that Japanese forces are "unconstitutional."

Despite objections from some legal scholars, the government has maintained the position that the forces are "constitutional" as it has interpreted the article as not banning Japan from possessing the "minimum necessary" capability to defend itself.

On foreign affairs, the Japanese prime minister is expected to place high importance on trying to settle a long-standing territorial row with Russia over a group of islands off Hokkaido and North Korea's abductions of Japanese nationals in the 1970s and 1980s.

More on Japanese politics:

Japan PM Abe to pursue constitutional change in 3 yrs if re-elected LDP chief

Japan's opposition leader Edano looks to lessons from Sanders to win youth support