Prayers were said for Syrian Refugee Mohammad Alhajali - the first fatality of the disaster to be formally identified by police - who was described as a "loving and caring person".
The 23-year-old, who was studying civil engineering at the University of West London, lived on the 14th floor of the block.
His brother Omar, 25, managed to escape from the fire after becoming separated from Mohammad, who was unable to get to safety.
Their parents, two sisters and several other relatives were able to secure visas allowing them to travel from Syria to attend the ceremony, called a Janazat, was held at the East London Mosque.
Mr Alhajali’s mother, father and siblings were at the front row of the mosque’s main prayer room, joined at their side by Mr Khan.
In a statement from the family read by friend Muzna Alnaib, they said Mr Alhajali "loved London and loved the people he met here".
It added: "He was a loving and caring person, always showing support and solidarity for friends and family stuck back in Syria," the statement read outside the mosque said.
"His very last words to us were how much he missed us. Ever since he moved away from us, we tried to be united with him and his brothers, and now, instead, we have been united by his body."
The family said they hope no one endures the pain they have in the past few days, and thanked everyone who has been so kind and helpful.
They also thanked more than 92,000 people signed a petition calling for his parents to be granted visas for the UK so they could attend his funeral.
Mr Alhajali fled war-torn Syria three years ago with his brother Omar, 25, who managed to escape the lethal blaze and was treated in Kings Cross hospital but was able to attend the funeral. The brothers came to the UK to seek safety and a better life.
But the 23-year-old is said to have been trapped on his floor for two hours while hundreds of firefighters sought to rescue residents, but failed to reach above the 13th floor.
The chairman of East London Mosque, Muhammad Habibur Rahman, told the congregation: "You will know that Mohammad Alhajali lost his life in the terrible incident in the Grenfell Tower fire that took place recently.
"We will pray for everybody who lost their lives in the fire and we ask Allah to have mercy on all of them and our condolences go to the families of all those who lost their lives."
Speaking after the service, Mr Khan said all people who were caught up in the fire and are uncertain about their immigration status should be allowed to stay in the country.
"My message to anybody who is nervous coming forward to report anything to the authorities because of their immigration status is this: the government has committed not to take any action against anybody whose immigration status is uncertain.
"I’m calling on the government to, on compassionate grounds, allow those inside Grenfell Tower who haven’t got right to remain to give them right to remain.
"It’s also crucial that we get to the truth and we get justice for all those struggling to cope in the aftermath of the Grenfell Tower fire.
"It’s important that the public enquiry commences as soon as possible, it’s important that all of the families, local community and civic groups have legal representation paid for by the government.”
Join our new commenting forum
Join thought-provoking conversations, follow other Independent readers and see their replies