At a news conference on Wednesday, Mr. Bolsonaro described the arrangement with the Cuban doctors as “slave labor,” adding that: “I couldn’t agree to it.”

He also posted a tweet in English accusing the Cuban government of dismissing the impact the decision to pull the doctors would have on Brazilian patients, and wrote that Havana was refusing to “fix the deplorable situation of these doctors in clear violation of human rights.”

More than 8,000 of the 18,000 doctors currently employed by the Mais Medicos program are Cuban, and their sudden departure would have a significant impact on Brazil’s neediest communities. The end of the program would also negatively affect Cuba’s bottom line. The government’s medical service export program is among its main sources of revenue.

According to Cuba’s Health Ministry, nearly 20,000 Cuban doctors have worked in Brazil as part of the program over the last five years, treating more than 113 million patients. Brazilian authorities say more than 60 million Brazilians who did not have access to a doctor now do as a result of Mais Medicos.

Cuba sends doctors to dozens of countries, sometimes to help with humanitarian crises and often as part of medical services contracts. Countries have paid the government millions of dollars every month to provide doctors, effectively making the doctors Cuba’s most valuable export.

But in Brazil, a growing number of the Cuban doctors have rebelled in recent years. Scores have filed lawsuits in Brazilian courts to challenge the arrangement demanding to be treated not as agents of the Cuban state but as independent contractors who should earn full salaries.