Saudi Arabia is building a 600-mile-long wall along its border with Iraq in an effort to keep out militants of the Islamic State group, who have stated that one of their key goals is to capture the two holy Muslim cities of Mecca and Medina, both of which lie in the Saudi territory.

The massive wall, from the northern town of Turaif close to the border with Jordan, to the eastern city of Hafal al-Batin, where Saudi Arabia and Kuwait meet, includes five layers of fencing with 40 watchtowers, sand embankments, radar and cameras, the United Press International (UPI) reported, adding that Riyadh has deployed 30,000 troops in the area.

The “Great Wall” of Saudi Arabia, as it is being dubbed by some media reports, was proposed during the 2006 Iraqi civil war, but work began only in September. The wall is expected to separate the Saudi desert territory from that of Iraq, which is struggling with the ongoing turmoil triggered by ISIS.

The barrier system came into limelight last week when ISIS militants attacked the border zone, killing three Saudi guards, UPI reported.

“It is the first attack by Islamic State itself against Saudi Arabia and is a clear message after Saudi Arabia entered the international coalition against it,” Mustafa Alani, an Iraqi security analyst with close ties to Saudi Arabia's interior ministry, told Reuters.

However, this is not the only fence with which Saudi Arabia hopes to contain foreign invaders. It is also building a physical barrier along its 1,000-mile southern border with Yemen, according to the Telegraph.

The Saudi-Iraqi wall is also considered to be a modern-day equivalent of the Great Wall of China, which was created in 206 B.C. to force enemies to go around the 5,500-mile structure.

ISIS considers Saudi Arabia's links to the West as a treachery of Islam. The group has reportedly called for lone-wolf attacks against Saudi security forces, as well as Shia Muslims and foreigners. Saudi Arabia is currently backing U.S.-led strikes on ISIS over Syria and Iraq.