DETROIT — Even in his final months, Muhammad Ali was speaking out on behalf of Islam, the religion he so famously embraced in the 1960s by changing his name and refusing to fight in the Vietnam War.
In December, the boxing legend issued a statement criticizing Republican presidential candidate Donald Trump’s proposal to ban Muslims from entering the United States. Ali called on fellow Muslims to ‘‘stand up to those who use Islam to advance their own personal agenda.’’
Ali, who died Friday at 74, endured public scorn when he joined the Nation of Islam as a young athlete. Decades later, long after he had achieved worldwide renown, he kept advocating for US Muslims who felt their religion made them political targets.
‘‘American Muslims would be well-served to look at the challenges that Muslims such as Malcolm X and Muhammad Ali had to deal with,’’ said Dawud Walid, executive director of the Michigan chapter of the Council on American-Islamic Relations.
Ali’s lesson ‘‘from that difficult period is that although he was criticized and marginalized for his beliefs, there were many people who were not Muslim that came to his defense,’’ said Walid, who is black and Muslim.
‘‘There are people in America today of good will who are not Muslim who are willing to stand with us. But we have to be the ones who have to be courageous and stand up for ourselves and be unapologetically Muslim and American,’’ he said.
Ali’s persistent views, both inside and outside the ring, won over many critics, according to Walid and other Muslims. While detractors didn’t always agree with him, many came to respect his principled stands.
In Louisville on Sunday, Ali’s younger brother, Rahaman, clapped and swayed to hymns and hugged members of King Solomon Missionary Baptist Church in the city’s west end. He put his hand to his face, overcome with emotion as church members paid tribute to the boxer.
The church has a painting by Ali’s father, Cassius Clay Sr., and isn’t far from the pink house where the champion grew up.
Assistant pastor Charles Elliott III said, ‘‘there is no great man that has done more for this city than Muhammad Ali.’’ Elliott’s father, the Rev. Charles Elliott Jr., recalled Ali’s generosity in support of an antihunger program in the city.
Muslims also have praised Ali’s humanitarian work, which included lending his name and time to numerous relief campaigns and helping to secure the release of American hostages in Iraq.
Born Cassius Clay in a segregated Louisville, Ali angered many Americans when he refused to fight in Vietnam. But in 2005, he was awarded the Presidential Medal of Freedom by President George W. Bush.
Lyndon Bilal, commander of the Muslim American Veterans Association, said through his ‘‘love, character, and courage,’’ Ali had ‘‘always been a friend of soldiers and America.’’
His long list of admirers includes many other athletes, especially other Muslims. Detroit Lions running back Ameer Abdullah said Ali’s devotion to Islam ‘‘will always be an inspiration for me.’’
‘‘Ali was a true ambassador for the Islamic community for his courage and devotion to his faith through very trying times,’’ Abdullah said.
Imam Abdullah El-Amin, founder and board chairman of the Muslim Center in Detroit, said Ali lost millions of dollars in potential earnings when, at the peak of his career, he was banned from boxing for 3½ years for ‘‘refusing to give up his religion’’ and declaring himself a conscientious objector to the Vietnam War.
That episode, Amin said, ‘‘gave us a lot of courage.’’
Like many African-Americans, Ali’s first foray into the faith was through the Nation of Islam, the black nationalist movement started in Detroit. He joined others in moving to a more integrated, traditional form of Islam in the 1970s.
In the 1980s, Amin said, he and Ali attended many of the same meetings for humanitarian groups and events in Detroit and Chicago. He remembers Ali for his ‘‘gentle spirit and generosity’’ but also as a merry magic prankster who would pretend to levitate but reveal to impressed guests how he did it, lest anyone think he was some type of ‘‘guru.’’
Walid remembers when Ali came into his home — in the form of an action figure. As a child in the 1970s, Walid said, he was ‘‘just having fun playing with toys,’’ but the doll from his parents proved to be a ‘‘subtle’’ influence on his eventual journey to Islam.
‘‘It not only made Muslims and Islam into something not threatening but actually . . . a type of nobility,’’ Walid said. ‘‘That continued with me.’’
Ali ‘‘represented to me what it meant to be a Muslim man — at a very young age.’’
One of Ali’s final messages was defending his faith. Trump’s comments, Ali said, ‘‘alienated many from learning about Islam.’’
Amin described Trump’s rhetoric as contributing to ‘‘hatred in our society,’’ which Ali spent years battling against.
‘‘People just wanted to look at him as a great fighter, but he was a great fighter for justice as well,’’ Amin said. ‘‘The best thing we can do for him is talking about his humanitarian work in the world. At the same time, we have to talk about his pushing . . . to enhance the human spirit.’’