Decision to pull doctors comes after Brazil’s president-elect vowed to take action against Havana programme.

Cuba announced on Wednesday that it will pull thousands of its doctors out of Brazil in response to president-elect Jair Bolsonaro’s “direct, contemptuous and threatening” remarks about its medical aid programme.

The far-right leader has repeatedly criticised the Communist-run island’s More Doctors programme, which sends thousands of Cuban doctors to work in deprived areas of Brazil, and said his government would introduce changes.

“In the light of this unfortunate reality, the Ministry of Public Health of Cuba has decided to discontinue its participation,” Havana said in a statement.

Bolsonaro has been scathing about Cuba’s management of the five-year-old programme, known in Brazil as “Mais Medicos”, saying the doctors received only a quarter of what Brazil was paying the Cuban government for their services.

His government would counteract that by directly hiring doctors who wanted to remain in the country, but would first demand they submit to a “capacity test”.

The Cuban health ministry angrily accused Bolsonaro of questioning its doctors’ qualifications, and said all Cuban cooperation workers had been paid “their full salary in Cuba”.

Bolsonaro hit back on Twitter.

“We made continuity of the More Doctors programme conditional on a capacity test, (payment of) full salary to Cuban professionals, most of which is currently going to the dictatorship, and the freedom to bring their families.”

“Unfortunately Cuba did not accept,” he wrote.

In another tweet, he accused Cuba of exploiting its citizens by not fully paying their salaries and said Havana was “irresponsibly” ignoring the negative impacts its decision will have on Brazilians.

Cuban President Manuel Diaz-Canel jumped to the programme’s defence, paying tribute on Twitter to the doctors’ “dignity, deep sensitivity, professionalism, dedication and altruism.”

They had “rendered a valuable service to the people of Brazil,” he added.

Bolsonaro later said on Wednesday that he will grant asylum to any Cuban national who asks for it.

The programme has been in place since August 2013, and since then nearly 20,000 Cuban doctors have treated 113.5 million Brazilians, according to the ministry.

In its strongly worded statement, Cuba said the conditions being imposed by Bolsonaro, who takes office on January 1, were “unacceptable”.

It added Cuban doctors, currently serving in 67 countries, have brought medical care to areas of “extreme poverty” whether in Rio de Janeiro’s favelas, Sao Paulo, Salvador de Bahia or the 34 Special Indigenous Districts, particularly Amazonia.