Saudi authorities announced Friday that they foiled a planned suicide attack in the Grand Mosque in Mecca, Islam’s holiest site. The suicide bomber blew himself up when police surrounded the building he was in, security forces said.

The kingdom has been accused by many, including U.S. President Donald Trump, of supporting terror, with Saudi nationals making up 15 of the 19 hijackers responsible for the 9/11 attacks. Parallels have also been drawn between Wahhabism, the ultraconservative form of Islam practiced in the kingdom and the ideology of militant group Islamic State (ISIS.)

Saudi is no stranger to terror attacks, with the country's ruling Al-Saud family facing repeat accusations of collusion with the West from Islamic radicals.

The first major attack on Saudi soil was the 1979 Grand Mosque siege, which occurred during the annual hajj pilgrimage and saw militants opposed to the alleged westernization of the Kingdom seize control of the mosque. The resulting two week siege left hundreds dead and was ended by Pakistani and French commandos. Captured militants were publicly executed.

During the first Gulf War, AL Qaeda founder Osama bin Laden had his Saudi citizenship stripped in 1994 after calling for Muslims to rise up against the reigning Saud dynasty after U.S. troops were stationed there.

Militants have since targeting westerners, Saudi government forces and religious minorities.

In 1996, a bomb exploded at a U.S. military base in Dhahran, killing 19 and wounding more than 300.

In 2001, several British workers were arrested following a series of bomb blasts in Riyadh in which a British and American national were killed. British citizen Ron Jones claimed he was tortured by police and forced to confess. He was released after being allowed to retract his confession.

Family members of victims and well wishers are seen after a suicide bomb attack at the Imam Ali mosque in the village of al-Qadeeh in the eastern province of Gatif, Saudi Arabia, May 22, 2015. A suicide bomber blew himself up at the Shi'ite mosque in eastern Saudi Arabia during Friday prayers, residents said, killing around 20 people and wounding more than 50, local residents and a hospital officials said. Stringer/REUTERS

But attacks targeting foreigners continued: In 2003 suicide attackers killed 35 people in compounds housing Westerners in Riyadh, injuring hundreds more. Weeks later an American was shot and killed at a naval base in Jubail. The attack sparked an exodus of Western expats from the country.

In November of that year, mostly Saudi nationals were victims of a suicide bombing in a housing compound west of Riyadh, in which 17 people died.

The bombs were blamed on al Qaeda militants opposed to the presence of Western troops in Saudi Arabia. Earlier that year the U.S. had announced it was significantly scaling down its military presence in the country.

The following year attacks escalated with a series of deadly attacks: Militants targeted security forces headquarters in Riyadh, a petrochemical site in Yanbu, an oil compound in Khobar, and the U.S. consulate in Jeddah.

Gun attacks in Riyadh in June 2004 left two Americans and a BBC cameraman dead. U.S. engineer Paul Marshall Johnson Jr. was kidnapped and beheaded on camera.

There followed a lull in attacks after local al-Qaeda leader Abdul Aziz al-Muqrin was killed by security forces. The government even offered a pardon to al Qaeda militants who turned themselves in during a 30 day amnesty.

Hundreds of suspects planning terror attacks were arrested in 2007, with some allegedly training as pilots for suicide missions. In the first trials of al Qaeda militants in the country the following year, 330 suspects faced charges. Only one was sentenced to death and authorities did not disclose how many were found guilty.

Diplomatic cables leaked to WikiLeaks that year revealed that the U.S. considered Saudi Arabia to be the main source of funding for extremist Sunni militants across the globe.

In 2014, Saudi Arabia banned ISIS, designating it a terror group and joining the international coalition combating it.

The group has launched a series of attacks in Saudi Arabia, killing 25 in attacks on Shia mosques in the country's eastern provinces in May 2015, and launching a series of bombings in July 2016, including one close to the Prophet’s Mosque in Medina.

In a recent visit to the Kingdom, Trump called on regional powers to step up their fight against Islamic extremism.