South Africa's main opposition party said on Tuesday it had taken legal action to force the government to arrest Russian President Vladimir Putin if he decided to attend a planned BRICS summit in the African country in August.

The Democratic Alliance party said it had launched a lawsuit to ensure the government detains Putin and extradites him to the International Criminal Court "if he sets foot in South Africa".

Shadow opposition Justice Secretary Glenis Brittenbach said: "This proactive judicial action is aimed at ensuring South Africa is meeting its obligations."

Breitenbach said the party was seeking an "advertising order" to avoid a repeat of 2015, when Pretoria failed to arrest then-Sudanese President Omar al-Bashir, who was also wanted by the ICC.

South Africa has faced a diplomatic dilemma since the Hague-based International Criminal Court (ICC) issued an arrest warrant in March for President Putin, as it is a member state of the International Criminal Court (ICC) and will be expected to execute the arrest warrant if he enters its territory.

The southern African country is due to host a BRICS summit of Brazil, China, India and Russia in August.

The Democratic Alliance's legal move comes as the government granted diplomatic immunity to officials attending meetings of BRICS foreign ministers this week and heads of state attending the upcoming summit.

The immunity includes a meeting of the group's foreign ministers in Cape Town from June 1 to 2, a government newspaper reported on Monday.

Bloomberg quoted the Department of International Relations and Cooperation as saying in an official statement that immunity will also include the BRICS leaders' summit scheduled for August 24-22.

The move was seen by some as a prelude to providing legal cover for Putin's visit, which Pretoria denied, and South Africa's foreign ministry confirmed in a statement that "these immunities do not cancel any warrant that any international tribunal may have issued against anyone who will attend the conference," and said that the issuance of immunities was "normal" for hosting international conferences.

South Africa invited Russian President Vladimir Putin to the summit, but Kremlin spokesman Dmitry Peskov declined on Tuesday to say whether Putin would go to the summit.

"Russia will be duly represented," Peskov said, adding that Moscow expects its BRICS partners "not to be guided" by what it called "illegitimate decisions" such as the arrest warrant.

South Africa has refused to condemn Moscow since the war in Ukraine began in February 2022, stressing that it should take a neutral stance to be able to "play a role in conflict resolution."