Murtza Chaudhry and Arbaaz Hussain, both 21, Zeeshan Khalid, 20, and Tayyab Siddique, 22, died when the BMW they were travelling in crashed on Toller Lane in Bradford on Thursday.
-> Four friends died in horrific high speed police chase crash in YorkshireAll four were remembered by crowds of people in a park in the city on Saturday afternoon.
Four hearses were driven into the packed field where the traditional prayers were said.
Before the ceremony, Imran Hussain, MP for Bradford East said he was born and brought up in the area.
He said: "I knew the young men and I know their families. The whole community is absolutely shocked and continues to be shocked.
"This is an extremely tragic loss of four very liked young men and the whole community is in mourning.
"People have turned up in their thousands to stand with the families."
Mr Hussain said all the men had "promising futures".
-> Police investigation body releases more details on high speed chase in which four young men diedHe said: "The whole community has come together, to stand together and provide support for each other in these difficult times."
The police watchdog is investigating the crash and has said that the BMW was being followed because it was moving at speed.
In a statement released on Friday, it said: "We understand at this time that the grey BMW 1 Series car in which they were travelling was pursued for a short time by an unmarked West Yorkshire Police car, due to excessive speed before the crash.
"All four men died at the scene."
The police watchdog also confirmed that there was "no indication" that the police vehicle made contact with the car prior to the accident.
The IOPC also said that there was approximately one minute between the BMW being spotted by the police and it colliding with the tree at around 5.30am on Thursday, according to the evidence it has analysed.
-> Photos show extent of crash wreckage in BradfordMr Hussain said there were some questions that need answering but said: "That's not for today."
Speaking to the crowd, Imam Mohammed Asim said: "The whole of Bradford has been rocked."
He pointed to a number of similar incidents involving car crashes in the city and implored families to stop young men driving fast cars at speed.
The Imam said: "We cannot let this happen again.
"Their whole lives were ahead of them. But you see what one moment of madness can do?"