KUWAIT CITY — Thousands of people in Kuwait took part in a mass funeral procession on Saturday for 27 people killed in an attack against a Shiite mosque in the capital a day earlier.

An upstart local affiliate of the Islamic State group, calling itself the Najd Province, claimed responsibility for the attack that was carried out by a suicide bomber during midday Friday prayers inside one of Kuwait's oldest Shiite mosques. The IS group views Shiites as heretics and refers to them derogatively as "rejectionists" among other slurs.

Braving the hot summer temperatures, mourners from as far as eastern Saudi Arabia and Bahrain attended the funeral and carried the Kuwaiti flag; others carried a simple black flag to signify mourning. Some in the crowd chanted, "Sunnis and Shiites are brothers!"

Every so often they chanted "Allahu Akbar," which means "God is Great" in Arabic.

Women ululated to praise those who had been killed during prayer and in the holy Muslim month of Ramadan — now in its second week — claiming they died as martyrs. They threw rose petals at the bodies, which were shrouded in the Kuwaiti flag.

A mother and her two young daughters passed out flower wreaths to place on the graves. To help people keep cool, a young man was seen misting people's faces with water. Still, paramedics were on hand to assist those who fainted from the heat as temperatures reached 107 degrees Fahrenheit (42 degrees Celsius).

Not all those killed in the bombing were buried in Kuwait. Some were sent to be buried in Najaf, Iraq at a Shiite holy site that is believed to be blessed. Iran's Foreign Ministry said three Iranians were among the 27 people killed in the attack.

The suicide bombing has rattled Kuwait, known for its relative wealth and stability. The last terrorist attack in Kuwait was more than two decades ago.

The Health Ministry said Saturday out of more than 200 people wounded in the attack, including many young boys, around 40 remain in the hospital while the rest have been discharged.

Within hours of Friday's attack, Kuwait's ruler Emir Sabah Al-Ahmad Al-Sabah, who is in his mid-80s, visited the site of the bombing. The government also declared that the country's main Sunni mosque, the Grand Mosque, will be open to mourners to pay their respects for the next three days.

Sunni groups in Kuwait and leaders from across the Middle East strongly condemned the attack, which Gulf officials say was aimed at provoking a backlash from Shiites and sparking sectarian war. More than a third of Kuwait's 1.2 million citizens are believed to be Shiite. The majority of Kuwaitis are Sunni Muslims, though Shiite Muslims hold seats in Kuwait's elected parliament and Cabinet posts.

Police in Kuwait said they are interrogating a number of suspects with possible links to the suicide bombing. The Interior Ministry said police also arrested the owner of the car that was used by the bomber.

Despite a heavy police presence at the funeral, volunteers set up their own check point at the gate of the cemetery to search men. The funeral was attended by several politicians, including the country's parliament speaker Marzouq Al-Ghanim.

"The unity of the people of our country is incredible," he said at the funeral. "If you look around you will see Sunnis and Shiites, Kuwaitis and non-Kuwaitis, all present to give their condolences to the families of the victims." (AP)