The agreement was announced on Thursday as Russian President Vladimir Putin hosted King Salman - the first sitting Saudi monarch to visit Russia - for talks at the Kremlin.
Along with the S-400 anti-aircraft missiles, Saudi Arabia is also set to buy Kornet anti-tank guided missile systems and multiple rocket launchers under the deal.
These agreements are "expected to play a pivotal role in the growth and development of the military and military systems industry in Saudi Arabia," Saudi Arabian Military Industries (SAMI), the kingdom's military industries firm said.
King Salman led a delegation to Moscow that also agreed on joint investment deals worth several billion dollars, providing a much-needed financial boost for a Russian economy battered by low oil prices and Western sanctions.
On the political front, there was no sign of any substantial breakthrough on the issues that divide Moscow and Riyadh, including the fact that they back rival sides in Syria's civil war.
"This is the first visit by a Saudi Arabian monarch in the history of our relations and that in itself is a landmark event," Putin said as he welcomed the Saudi leader in an ornate gilded Kremlin hall.
"I'm sure your visit will boost the ties between our countries," he said.
"We aim to strengthen our relations in the interests of peace and security, in the interests of developing the world economy," the Saudi king responded.
Addressing regional affairs, King Salman told Putin that Iran must stop meddling in Middle Eastern conflicts.
"We emphasise that the security and stability of the Gulf region and the Middle East is an urgent necessity for achieving stability and security in Yemen," the king said.
"This would demand that Iran give up interference with the internal affairs of the region, to give up actions destabilising the situation in this region."
Iran and Saudi Arabia have supported opposing sides in ongoing conflicts in Syria and Yemen. Russia, like Iran, is also a key partner of the Syrian government of President Bashar al-Assad, who Saudi Arabia has opposed.
While there was no hint of a major political development, there was no hint of any public discord either. Briefing the media on the talks between Putin and King Salman, Russian Foreign Minister Sergey Lavrov focused on the common ground between the two countries.
The two leaders had a "friendly and substantial discussion based on a desire by Moscow and Riyadh to consistently grow mutually-beneficial partnerships in all spheres", Lavrov said at a press conference alongside his Saudi counterpart, Adel al-Jubeir.
He added that the two leaders had agreed on the importance of fighting "terror", of finding peaceful solutions to conflicts in the Middle East and on the principle of territorial integrity.
For his part, al-Jubeir said that "we believe that new horizons have opened up for the development of our relations that we could not previously have imagined".
Speaking through an interpreter, he added. "Relations between Russia and Saudi Arabia have reached an historical moment. We are certain that the further strengthening of Russian-Saudi relations will have a positive impact on strengthening stability and security in the region and the world."
Relations between the two countries in the past have often been strained. During Cold War times, the Saudis helped arm Afghan rebels fighting against the Soviet invasion.
More recently, tensions were high over the war in Syria. However, relations have begun to improve in recent years and King Salman's heir, Crown Prince Mohammed bin Salman, has held several meetings with Putin.
Al Jazeera's Rory Challands, reporting from Moscow, said a good amount of trust had been built between Saudi Arabia and Russia, and it is changing the political landscape.
"The two have been coordinating their efforts to cap oil outputs and therefore boost the price of energy, but of course there is the changing political structure of the Middle East too," he said.
"The fact that you can argue that the US influence in the region is receding and Russia's is increasing, and in the last few months we have seen a good number of Middle Eastern leaders including those of Egypt, Jordan, Saudi Arabia, Israel, Turkey, all coming to Moscow essentially hedging their bets and realising that Russia is an emerging power and the US perhaps a declining one."
The kingdom, much like Russia, has been hit by the fall in oil prices since mid-2014. Despite regional disagreements, the two countries found common ground on energy policy in November when they led a deal between OPEC and non-OPEC states to cut production in a bid to shore up crude prices.
So far, that deal is holding.
Saudi Arabia's Public Investment Fund, the kingdom's sovereign wealth fund, announced in 2015 plans to invest $10bn in Russia over the next five years, though only a fraction of that has so far been put up.
Source: Al Jazeera and news agencies