JEDDAH, SAUDI ARABIA -- A Saudi citizen wounded a guard in a knife attack at the French consulate in Jeddah Thursday, officials said, as France faces growing anger over satirical cartoons of the Prophet Mohammed.

The assault follows another knife attack at a church in the French city of Nice that left three people dead and several others wounded, in what authorities are treating as the latest jihadist attack to rock the country.

"The assailant was apprehended by Saudi security forces immediately after the attack. The guard was taken to hospital and his life is not in danger," the French embassy said in a statement.

Police in Mecca province, where Jeddah is situated, said the attacker was a Saudi, but it did not give the nationality of the guard, who they said had sustained minor injuries.

The French embassy in Riyadh strongly condemned the attack and urged its nationals in Saudi Arabia to exercise "extreme vigilance".

Neither the Saudi authorities nor the French embassy gave any indication of the motivation for the attack.

But it comes after French President Emmanuel Macron vigorously defended the publication of satirical cartoons of the Prophet Mohammed by the satirical magazine Charlie Hebdo on free speech grounds.

Regional heavyweight Saudi Arabia -- home to Islam's holiest sites -- has criticised the cartoons, saying it rejected "any attempt to link Islam and terrorism" but it stopped short of condemning the French leadership.

Macron's defence of Charlie Hebdo's right to publish drawings of the Prophet, which is forbidden under Islam, came after the brutal murder on October 16 of a French school teacher who had shown cartoons to pupils during a class discussion about freedom of speech.

SPOTLIGHT ON SAUDI

The history teacher, Samuel Paty, was killed by an 18-year-old Chechen man, Abdullakh Anzorov, who committed the gruesome crime outside Paty's school in a Paris suburb after the teacher was denounced by angry parents on social media.

His murder prompted Macron to promise a crackdown in Islamic extremism, including shutting down mosques and organizations accused of fomenting radicalism and violence.

Charlie Hebdo was targeted by jihadists in a 2015 massacre that killed 12 people, including some of its most famous cartoonists.

France has been on high alert for terror attacks since the massacre. The trial of suspected accomplices in that attack is under way in Paris.

On Thursday Muslims across the region are celebrating the anniversary of the Prophet's birthday.

The Jeddah attack puts a spotlight on Saudi Arabia, long criticised for promoting an ultra-conservative brand of Islam.

The kingdom, however, is now in the midst of a once unimaginable liberalisation drive as it pushes a new era of openness while de-emphasising religion.

As part of the contentious drive, the kingdom has introduced glitzy mixed-gender concerts, magic shows and sporting extravaganzas with thumping after parties.

Last November, a Yemeni national wounded four Spanish nationals when he went on a stabbing spree during a live theatre performance in Riyadh.

Saudi state media pinned the blame on al Qaeda, but so far there has been no claim of responsibility from the group and observers point at simmering resentment among arch-conservatives in the kingdom over the entertainment push.