JOHANNESBURG (Reuters) - Almost 20 South African companies linked to the Gupta family have lost a court bid to have India's Bank of Baroda, the last lender doing business with the firms, maintain its operations in the country, local news service Eyewitness News said.

Baroda's South African division was thrust into the spotlight two years ago when it agreed to take on the Guptas after South Africa's major banks turned their back on the family's businesses due to reputational risks.

Baroda said a month ago that it had pulled the plug on its South African business, citing a strategic shake-up to slim down in international markets.

The Guptas, a trio of Indian-born brothers, have been accused by the South African public anti-graft watchdog of using their friendship with former president Jacob Zuma to influence policy decisions. Zuma and the Guptas deny any wrongdoing.

The local Eyewitness News (EWN) service said that the High Court in Pretoria had dismissed the Gupta companies' application to prevent the Indian bank from closing its South African operations.

In his ruling, Judge Ntendeya Mavundla said the bank's right to trade or not to trade supersedes whatever right, if any, the applicants might have, EWN reported.

This will make it all but impossible for the companies to operate in South Africa. Some of their assets such as the Optimum coal mine are currently in business rescue proceedings.

Official documents showed last month that at least eight companies owned by the wealthy Gupta family had filed for protection from creditors.

Reuters could not immediately get a copy of the ruling or reach officials from Gupta companies and Baroda, which is no longer operating in South Africa.

The country's chief prosecutor last month declared Ajay Gupta a "fugitive from justice" after he failed to hand himself in to police, who are conducting an investigation on the family.

Pressure has been mounting on the Guptas since Zuma was forced from office last month by the ruling African National Congress party. His resignation came just hours after police raided the luxury home of the Gupta family.

Indian tax inspectors last Tuesday raided premises of the Gupta family. Amrendra Kumar, a senior income tax official in India's Uttar Pradesh state, told Reuters that the Gupta brothers were suspected of finding ways to bring "illicit money" they had earned abroad into India.

(Reporting by Ed Stoddard; Editing by James Macharia and Louiser Heavens)