KUWAIT CITY -- A suicide bomber purportedly from an Islamic State affiliate unleashed the first terrorist attack in Kuwait in more than two decades on Friday, killing at least 27 people and wounding scores more in a bombing that targeted Shiite worshippers after midday prayers.

The attack, which hit the capital of Kuwait City, was one of three deadly attacks from Europe to the Middle East on Friday that followed the Islamic State group's call for violence during the Muslim holy month of Ramadan.

It also underscored the Islamic State group's reach and its ability to carry out large-scale attacks -- even in this mostly quiet and relatively secure Gulf Arab nation, with its wealthy capital that is home to glistening shopping malls, five-star hotels and Western retail chains.

The bombing struck the Imam Sadiq Mosque in the residential neighbourhood of al-Sawabir, one of the oldest Shiite mosques in this predominantly Sunni Arab nation where at least at third of the population is believed to be Shiite Muslim.

The explosion ripped through the back of the mosque, near the door, as worshippers stood shoulder-to-shoulder in group prayer, according to one of the witnesses, Hassan al-Haddad. He said that other worshippers behind him recounted seeing a man walk in, stand in the back with other congregants and detonate his device.

A posting on a Twitter account known to belong to the IS affiliate that calls itself the Najd Province, claimed the explosion was the work of a suicide bomber. It was the third attack in five weeks to be claimed by Najd Province -- a name that's a reference to the central region of Saudi Arabia. The upstart IS branch had claimed two prior attacks on Shiite mosques in Saudi Arabia that killed 26 people in late May.

The Islamic State extremists regard Shiite Muslims as heretics, and refer to them derogatively as "rejectionists." The IS statement said the bombing targeted a "temple of the apostates."

Witness Ahmed al-Shawaf said he heard a man interrupt the prayer by shouting "Allahu Akbar," which means "God is Great" in Arabic. The man then yelled out something about joining the Prophet Muhammad for iftar, the dusk meal at which Muslims break their daytime fasting Ramadan, now in its second week. Then, the blast came, al-Shawaf said.

The explosion took place near the end of a second prayer, which is traditional to Shiites and follows the main midday Friday prayer.

The Ministry of Interior said in its latest statement that 27 people were killed and 227 were wounded, all of then males, including some boys. Police formed a cordon around the mosque's complex immediately after the explosion. Ambulances could be seen ferrying the wounded.

A panicked mother outside the mosque yelled at police to let her inside to find her son. The policemen allowed her through and she emerged shortly afterward and fainted. Worried relatives and shocked onlookers huddled around the mosque.

For decades, Kuwait has been among the safest and quietest corners of the Middle East. It suffered an invasion under former Iraqi leader Saddam Hussein in the first Gulf War, but has not traditionally been a target of terrorist attacks.

The last massive attack here was in 1983, when Iranian-backed Shiite militants from Iraq carried out bombings that killed at least five people and targeted Western embassies.

Kuwait has one of the most free-wheeling political systems in the Gulf, and tolerates limited protests. Kuwaiti Shiites hold seats in the elected parliament as well as Cabinet posts, and unlike their counterparts in Bahrain and Saudi Arabia, have not complained of severe discrimination.

Soon after Friday's attack, Kuwait's ruler, Emir Sabah Al-Ahmad Al-Sabah, who is in his mid-80s, visited the bombed mosque. The Cabinet convened an emergency session in the afternoon. Arab leaders from across the Gulf rushed to condemn the attack.

But the attack also drew criticism from some Kuwaitis, who said the country's leaders should have been more pro-active in protecting Shiites.

Jasim al-Awadh, who rushed to the mosque to try and help with the wounded, said the government should have increased security measures around Shiite places of worship in Kuwait after the attacks in Saudi Arabia. He said the government turns a blind eye to Sunni extremists in the country.

Saudi Arabia and other petro-powerhouses in the Gulf for years allowed a flow of private cash to Sunni rebels in Syria fighting to topple President Bashar Assad, who is backed by Shiite powerhouse Iran. When the IS group began taking over large swaths of territory in Iraq and Syria, Gulf nations feared its extremism could be a threat to them as well, and began clamping down on fundraising as well as calls for jihad.

"I feel angry," Kuwaiti rights activist Ebtehal al-Khateeb said. "We want a complete approach and solution. There have to be serious changes in the region, not just in Kuwait."

Gulf officials warn that the Islamic State group is trying to provoke a reaction from Shiites, which could in turn destabilize or even upend the rule of the Mideast's Western-allied monarchies.

Abdullah al-Neybari, a secular former lawmaker, said the Kuwaiti government "is not doing what it should be doing to fight extremism in the country. "

"This is a wakeup call to fight harder," he said.

Associated Press writers Aya Batrawy in Dubai, United Arab Emirates and Maggie Michael in Cairo contributed to this report.