YOGYAKARTA, Indonesia - Courtiers in elaborate outfits danced to the gentle tinkling of Javanese music as the Sultan of Yogyakarta looked on, a scene that has played out in much the same way for centuries in the tiny Indonesian kingdom.
But the recent ceremony to mark the 70th birthday of Hamengku Buwono X, Indonesia's last sultan with real political power, had one key difference from previous celebrations -- many of his relatives refused to attend.
A bitter feud has erupted at the heart of the kingdom on Java island, after the Muslim ruler signalled he wants his eldest daughter to become the sultanate's first female monarch after he leaves the throne.
Indonesia is home to numerous small kingdoms. But while other provinces now elect political rulers and their sultans are largely ceremonial figures, Yogyakarta's sultan serves as both royal leader and governor of the city and its surrounding areas.
Jakarta allowed the Yogyakarta royal family to keep power as the central government was grateful for the sultanate's support for independence in 1945 after a long period of Dutch colonial rule.
The sultan still maintains many of the trappings of Javanese royal rule in the kingdom, which has a history stretching back to the 16th century.
His main residence is a traditional Javanese palace complex, known as a Kraton, and important events are celebrated with much pomp and circumstance.
But the sultan's push to make the eldest of his five daughters -- he has no sons -- the first female monarch of Yogyakarta has transformed him into an unlikely champion for gender equality, and threatens to overturn hundreds of years of tradition in the Muslim, conservative sultanate.
It has sparked a furious row with his family, who say he is breaking rules laid down to govern the sultanate, amid speculation that his brothers were jockeying to fill his position.
"A female sultan is an impossibility," the sultan's cousin, Kanjeng Raden Tumenggung Jatiningrat, told AFP.
"One symbol in this palace is a rooster -- so if we have a queen should we change it to a hen?"
The rooster is a symbol of bravery.
He added that a female ruler could not oversee rituals in the mosque or other ceremonies that have traditionally been led by men.
Hamengku Buwono, who has been on the throne 27 years, last year set in motion the process for his daughter to become monarch by giving her the title "Gusti Kanjeng Ratu Mangkubumi".
While he has not confirmed publicly that she is the crown princess, in Javanese culture -- where much is conveyed through symbolism rather than anything said out loud -- the signs are clear.
The title Mangkubumi, which translates from Indonesian as "the one who holds the Earth", was the same one given to the sultan when he was made crown prince several decades ago.
She was also entrusted with the task of "attempting to bring safety, happiness and prosperity to the world", another indication she would succeed her father.
And the sultan made small changes to his own lengthy royal title -- removing a word normally only used by men and tweaking another -- to make it gender-neutral, opening the door for a woman to take over.
The sultan has defended the move, saying there is nothing stopping him from making changes in his kingdom and he has to adapt as Indonesia modernises.
"The Yogyakarta palace doesn't have a hereditary tradition that can't be changed, and all ruling sultans can introduce changes," he told local media.
Still, many disagree with him, from his relatives to local Muslim groups.
"The king should maintain the tradition as it was originally, because this is an Islamic kingdom," said Abdurrahman, from local hardline group Islamic Jihad Front, who like many Indonesians goes by one name.
But it is not the first time there has been a female monarch in diverse Indonesia -- nowadays Muslim-majority, but which has had Hindu and Buddhist kingdoms over the centuries and is home to about 300 different ethnic groups.
Queens at times ruled over the ancient Majapahit empire, which covered large parts of what is now Indonesia from the late 13th to the early 16th centuries, as they did in Aceh, on western Sumatra island, when it was an independent sultanate.
And the sultan's approximately four million subjects in Yogyakarta and the surrounding area, who view him as a demi-God, have had only a muted a reaction, with most preferring to keep out of royal affairs.
Nevertheless the row looks unlikely to be resolved any time soon, and it cast a long shadow over the recent celebration, which marked the anniversary of the sultan's coronation as well as his birthday.
The solemn melodies from the "gamelans" -- a traditional Indonesian instrumental ensemble, made up of bronze percussion instruments -- were a million miles from the seething tensions swirling around the royal succession.
"About 90 per cent of the family don't respect him anymore," raged Gusti Bendoro Pangeran Haryo Prabukusumo, a step-brother of the ruler who snubbed the event.