BEIRUT — The Islamic State group claimed responsibility on Thursday for the explosion the previous day at a cemetery in Saudi Arabia, saying it primarily targeted French diplomats attending the ceremony in remembrance of the end of World War I.

Other Europeans and Americans were attending the ceremony at the Non-Muslims Cemetery in the kingdom's coastal city of Jiddah. The blast wounded three people, leaving them with light to minor injuries.

IS said in a posting on its news agency, Aamaq, that it primarily targeted the French consul attending the ceremony because of his country's publication of caricatures of the Prophet Muhammad.

The claim was also carried on one of the militant Telegram channels used by IS, which said its fighters were able to plant the explosive device at the ceremony. The militant group offered no proof for its claim.

Aamaq said other European countries at the ceremony were also considered targets because they are part of the international coalition fighting Islamic State militants. The U.S-led coalition against IS declared victory against the group in early 2019 after it drove its militants out of territories they controlled in Syria and Iraq.

But remnants of the militant group have dispersed into the desert in both Syria and Iraq, while others also fled to their home countries. Thousands of others languish in Syrian and Iraqi jails.

While the group never had a major presence in Saudi Arabia, the last major attack its militants carried out in the kingdom was in 2015.

In remarks carried by the state-run Saudi Press Agency on Thursday night, Crown Prince Mohammed bin Salman pledged to "strike with an iron fist against anyone who would like to undermine our security and stability."

France has been the target of three attacks in recent weeks that authorities have attributed to Muslim extremists.

The prophet caricatures, which returned to the public domain earlier this year, are deemed offensive by many Muslims and have sparked protests in Asia and the Middle East, with calls for boycott of French products. They were also seen as the trigger for several attacks against French nationals and interests in recent weeks.

The attacks included the beheading of a French teacher outside Paris who showed caricatures of the Prophet Muhammad to his class. Three people were later killed in a church in the southern city of Nice.

Wednesday's explosion in the port city of Jiddah wounded one U.K. national, a Greek policeman and a Saudi security officer. It followed a stabbing attack last month that lightly wounded a security guard at the French Consulate, also in Jiddah. The attacker, a Saudi man said to be in his 40s, was arrested but his motives for the assault remain unclear.

An Islamic State sympathizer also carried out a deadly attack in Austria earlier this month.

The Saudi Embassy in The Hague was sprayed with gunfire early on Thursday, leaving bullet holes across the facade and in several windows. Nobody was hurt, according to the Dutch police.

It is not clear if all these attacks are related.

Some 20 people of different nationalities were attending the ceremony in Jiddah. Wednesday marked the 102nd anniversary of the armistice ending World War I, a day that was also commemorated in several European countries.

The Non-Muslim Cemetery sits near Jiddah's docks, hidden behind trees alongside a major thoroughfare in the city. The Commonwealth War Graves Commission — which maintains places of commemoration for military service members from British Commonwealth nations — shows just one soldier buried at the cemetery, Pvt. John Arthur Hogan, who died in June 1944.

In 2015, an IS suicide bomber attacked a mosque inside a police compound in Abha, 350 miles south of Mecca, killing 15 people in the deadliest attack on the kingdom's security forces in years. Eleven of the dead belonged to an elite counterterrorism unit whose tasks include protecting the hajj pilgrimage.