Image copyright Reuters Image caption Muhammad Ali personally planned his own funeral in the years before his death

Worshippers and fans of Muhammad Ali have attended a Muslim prayer service to honour the legendary boxer in his hometown of Louisville, Kentucky.

The two-day funeral was planned by Ali in the years before his death, according to a family spokesman.

Ali wanted the Muslim prayer service, known as a Jenazah, to be "a teaching moment", according to Imam Zaid Shakir, who led the service.

Muhammad Ali, "The Greatest", died on Friday aged 74.

More than 14,000 people had tickets to the event at the site of Ali's last fight in Louisville in 1961.

Obituary: Muhammad Ali

The man who changed his sport and country

Muhammad Ali - in his own words

World pays tribute to boxing legend

Ali's love affair with Africa

American Muslims attending the service and watching on TV said they hoped that the public prayers would help Americans to become more familiar with Islam and its practices.

In 1964, Ali famously converted to Islam, changing his name from Cassius Clay, which he called his "slave name".

He first joined the Nation of Islam, a controversial black separatist movement, before later converting to mainstream Islam.

He travelled the world as a boxer and speaker, and inspired Muslims around the world.

Abdul Rafay Basheer, 25, travelled from Chicago for the service and said he saw Ali as an ambassador for Muslims. He said the prayer service would help to demystify his religion.

That was a theme taken up by Dawud Walid from the Council on American-Islamic Relations.

"In a political climate in which Islamophobia is front and centre, his funeral will counterpunch the ridiculous notion that being a good Muslim and a good American are at odds," he said.

Ali "was willing to sacrifice the fame, the lights, the money, the glamour, all of that, for his beliefs and his principles," Imam Shakir said in his address to the packed auditorium after reciting prayers over Ali's coffin.

Image copyright Getty Images Image caption Ali often prayed in mosques during his travels throughout the world

The funeral will continue on Friday with an interfaith memorial service and procession through Louisville passing key locations such as Ali's childhood home, and a museum dedicated to him.

Tickets to attend the Friday service ran out only one hour after they became available.

World leaders and celebrities will attend, including former US President Bill Clinton and Turkish President Recep Tayyip Erdogan. President Barack Obama will not be able to attend due to his eldest daughter's graduation on the same day.

Image copyright Reuters Image caption The casket with the body of Muhammad Ali was prayed over by thousands

Speaking after Jenazah prayers, Dr Sherman Jackson, an Islamic scholar, used a boxing term to describe how "Ali put the question of whether a person can be a Muslim and an American to rest. Indeed, he KO'ed that question."