 However, he was still appointed as an adviser to the central leadership of Muhammadiyah until the end.In 1973, he testified in support of Vivian Rubiyanti Iskandar's petition before the West Jakarta District Court for legal recognition of her gender, saying that "[her desire to transition] does not run contrary to Allah's law, but in keeping with the teachings of Islam, which holds good will to all in high esteem".Hamka died on the 24th July 1981, and his remains were interred at Tanah Kusir Public Cemetery.