FILE PHOTO: Brazil's President-elect Jair Bolsonaro attends a meeting with governors-elect in Brasilia, Brazil November 14, 2018. REUTERS/Adriano Machado

RIO DE JANEIRO (Reuters) - As Cuban doctors in Brazil begin to head home amid a diplomatic spat between Havana and the South American country’s far-right president-elect, Brazil’s health ministry said on Friday that it had filled nearly all of the resulting vacancies.

The first of thousands of Cuban doctors left Brazil on Thursday after criticism by incoming President Jair Bolsonaro prompted Cuba’s government to sever a cooperation agreement, leaving millions of Brazilians without medical care.

Many of the Cuban doctors worked in poor, rural parts of Brazil, where few Brazilian physicians want to be.

The health ministry said in a statement that it had managed in three days to get 92 percent of the Brazilian doctors needed to replace the departing Cubans, signing up 25,901 physicians. More than 17,500 had been enlisted, while almost 8,000 had already been allocated to specific municipalities, the statement said.

The health ministry said earlier in the day that a web portal to handle inscriptions, open until Dec. 7, had suffered cyber attacks, which had caused some problems, but the site was now stable.

Bolsonaro has said the Cuban doctors were being used as “slave labor” because Havana took 75 percent of their salaries. He said the program, which began in 2013, could continue only if they got full pay and were allowed to bring their families.

Bolsonaro, an admirer of U.S. President Donald Trump, was elected last month by Brazilians fed up with rising crime and rampant corruption that reached new highs during almost a decade-and-a-half of leftist governments with close ties to Cuba.

Cuba has a respected health service and generates major export earnings by sending more than 50,000 health workers to over 60 countries. Even though they received only a fraction of their salaries, the money was good for the doctors by Cuban standards.