DUBAI - Three Saudi brothers have been arrested in connection with the suicide bombing of a Shi’ite mosque in Kuwait last month, the Saudi and Kuwaiti authorities said on Tuesday.

The attack during Friday prayers, which killed 27 people including the bomber, appeared aimed at stoking sectarian hatred in the energy-rich Gulf. Islamic State claimed responsibility.

The three brothers were “parties to the crime of the sinful terrorist bombing that targeted the Imam al-Sadeq mosque in Kuwait,” the SPA state news agency cited a security spokesman for the Saudi interior ministry as saying.

Two of the suspects, Majed and Mohammed al-Zahrani, drove across the border into Kuwait on Thursday afternoon carrying the explosives for the attack in an ice cooler, Kuwait’s interior ministry said in a statement. They left after passing the materials to Abdul-Rahman Sabah Aidan, an illegal resident in Kuwait who reportedly drove the bomber to the mosque and is now in custody, the ministry said.

Investigators found the explosives were of the same type used in two suicide bombings on May 22 and May 29 against Shi’ite mosques in eastern Saudi Arabia, where the bulk of the kingdom’s Shi’ite minority lives, according to the ministry.

Majed was arrested in the western Saudi city of Taif while Mohammed was taken into custody after a shootout at a house near the Kuwaiti border in which two policemen were wounded. A third brother, whom the ministries did not name and whose precise role was not described, was arrested in Kuwait and extradited to Saudi Arabia.

A fourth brother lives in Syria and is a member of Islamic State, SPA cited the Saudi security spokesman as saying.

The bombing was Kuwait’s deadliest militant attack and the most lethal in any of the six hereditary-ruled Gulf Arab states since a campaign of al Qaeda bombings was stamped out in Saudi Arabia a decade ago.

The attack has raised concerns about the number of young Saudi men willing to travel to attack Shi’ites in smaller Gulf Arab states and so make good on a threat by Islamic State to step up violence in the holy fasting month of Ramadan.

The Saudi branch of the militant group has said it wants to clear the Arabian Peninsula of Shi’ites and has urged young men in the kingdom to join its cause.