Japan has passed legislation paving the way for 83-year-old Emperor Akihito to abdicate. The law sets the stage for the first abdication of a reigning monarch in two centuries, in a royal family which has a history stretching back 2,600 years.

The upper house of the Japanese parliament passed the bill on Friday in a vote broadcast live on NHK TV. The lower chamber had already given its approval on the legislation earlier in June.

“Abdication will take place for the first time in 200 years, reminding me once again of how important an issue this is for the foundation of our nation, its long history, and its future,” Prime Minister Shinzo Abe told reporters later, as cited by Reuters.

The government should now discuss the terms of abdication and its timing, which is believed to be in 2018, according to reports in Japanese media and Reuters. Akihito’s son, Crown Prince Naruhito, 57, is presumed to succeed the Chrysanthemum Throne.

Akihito made headlines back in summer 2016 when he announced his plans to step down, citing health problems. The monarch, who ascended the throne in 1989, has had heart surgery and received treatment for prostate cancer.

AFP graphic showing the family tree of the Japanese monarchy as parliament passes law clearing way for ageing Emperor Akihito to step down pic.twitter.com/LHb0GCJDPi

According to the 1947 Imperial House Law that regulates the line of imperial succession, the emperor cannot step down. The last Japanese monarch to abdicate was Emperor Kokaku, who left in favor of his son back in 1817.

Another issue the Japanese government will discuss is the continuity of the heirs, as women are not allowed to inherit the throne. Additionally, a woman from the imperial family who marries outside the family is then excluded. Akihito has another son, Prince Akishino, and a grandson, Hisahito, aged just 10. All the other members of the royal family are female.

“The number of Imperial family members is decreasing because of the marriage of female members and other reasons,” Chief Cabinet Secretary Yoshihide Suga told a special upper house session on the legislation on Wednesday, as cited by the Japan Times.

“Considering the ages of the imperial family members, this is an important problem that we cannot shelve,” he added. There were eight empresses in Japanese history, but a 19th-century law banned women from the throne.

Many lawmakers are calling for the current system to be changed and for women to be allowed to reign. Abe is reportedly against the measure, however, and “strongly prefers” the current system, his aide said, as cited by the Japan Times.

The Imperial House of Japan is thought to be the oldest monarchy in the world, reigning for more than 2,600 years. The first emperors, who are believed by many in Japan to have been the descendants of the sun goddess Amaterasu, have only mythical records. Akihito is considered the 125th emperor of the country.