Japan's parliament passed a law on Friday that clears the way for its ageing Emperor Akihito to step down, in what would be the first imperial abdication in more than two centuries.
The popular 83-year-old monarch shocked the country last summer when he signalled his desire to take a back seat after nearly three decades on the Chrysanthemum Throne, citing his age and health problems.
The unexpected move presented a challenge since there was no law to deal with an emperor retiring from what is usually a job for life - and it reignited debate about allowing women to ascend the male-only throne.
The one-off rule was passed in the last-stage upper house today in a unanimous decision after the lower chamber gave its stamp of approval last week.
The abdication must take place within three years - and it only applies to Akihito.
Tokyo is eyeing the end of 2018 as a likely timeline for his retirement, Japanese media said.
The status of the emperor is sensitive in Japan given its 20th-century history of war waged in the name of Akihito's father Hirohito, who died in 1989.
Some worried that changing the law to allow any emperor to abdicate could put Japan's future monarchs at risk of being subject to political manipulation.
Akihito, who has been treated for prostate cancer and had heart surgery, is expected to step aside in favour of his eldest son, Crown Prince Naruhito, 57.
There have been abdications in Japan's long imperial history, but the last one was more than 200 years ago, so politicians had to craft new legislation to make it possible.
"The one-off law is a result of political compromises, but it will become a precedent for future abdications," said Setsu Kobayashi, a constitutional expert and professor emeritus at Japan's Keio University.
Akihito was born in 1933 just as Japan was embarking on its militaristic sweep across Asia, and was 11 when the war ended in defeat.
His father was allowed to remain on the throne after Japan's defeat, but his status was downgraded from semi-devine sovereign to a figurehead with no political power.
Akihito embraced the role and tried to use it to help heal the scars of the war while remoulding one of the world's oldest monarchies for a democratic age.
Even before he assumed the throne, Akihito broke with tradition when he married the daughter of a wealthy flour magnate in 1959, becoming the first imperial heir to wed a commoner.
The emperor and his wife Empress Michiko are seen as being the more accessible face of a monarchy that largely remains in the shadows, unlike the British royals.
The couple has frequently attended public events and console victims of natural disasters, including Japan's 2011 quake-tsunami disaster.
Akihito is barred from commenting on politics, but he has over the years hinted at his own anti-nationalist views.
Speaking at a memorial marking the 70th anniversary of Japan's surrender, Akihito expressed "deep remorse" for the country's actions in World War II.
Some saw this as a rebuke to nationalist Prime Minister Shinzo Abe, who has pushed to change Japan's pacifist constitution and prevent Japanese from having to apologise again for the nation's warring past.