Police have arrested a number of people, among them a Kuwaiti citizen, suspected of being behind a suicide bombing at a Shiite mosque that killed 27 people, Kuwait's Interior Ministry said early Sunday.

The announcement came just hours after thousands of people took part in a mass funeral procession on Saturday for those killed in the country's first terror attack in more than two decades.

An upstart local affiliate of the Islamic State group, calling itself the Najd Province, claimed responsibility for the bombing, which took place during midday Friday prayers inside one of Kuwait's oldest Shiite mosques. The IS group views Shiites as heretics and is fighting Iranian-backed Shiite militias in Iraq and Syria.

The Interior Ministry said in its statement that one of the suspects arrested is a Kuwaiti man who was using his home as hideout for the others. Police said another suspect is a 25-year-old from Kuwait's "bidoon" community, which is largely made up of descendants of desert nomads considered stateless by the government. They have long claimed the government is depriving them of citizenship and rights.

The arrests highlight the threat posed to Western-allied monarchies in the Gulf from young locals lured to the IS group's extremist ideology and its call for supporters to carry out homegrown attacks.

Police did not say how many suspects have been arrested. The government-linked Al-Jarida newspaper reported that seven suspects had been detained overnight.

The suicide bombing has rattled Kuwait, known for its relative wealth and stability.

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.

Braving the hot summer temperatures, mourners from as far as eastern Saudi Arabia and Bahrain attended Saturday's 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 people killed in the attack.

Within hours of the 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, would be open for mourners to pay their respects over the next three days.

Despite a heavy police presence at the funeral, volunteers set up their own checkpoint 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."