Thousands of Cuban doctors will be traveling to Brazil to work in areas where medical services and doctors are in desperate demand. The Brazilian Health Ministry signed the agreement on Wednesday with the U.S.-based Pan-American Health Organization (PAHO), which will bring 4,000 doctors from Cuba to Brazil by the end of the year.

The deal came after Brazil's failed efforts to attract Brazilian and foreign doctors from other countries. After protesters demanded better public services in May, Brazil's President Dilma Rousseff made efforts to respond to concerns by announcing the More Doctors program a month later.

When it was first introduced in June, the More Doctors program hoped to receive 15,000 doctors. So far, it has only managed to accrue 1,300 and, of those, 1,000 are Brazilian; the rest are either Brazilians from overseas or doctors from Argentina, Spain, and Portugal. According to the Ministry, there are currently 3,500 cities and towns signed up for the program.

The program is designed to send doctors to work in needy urban and rural areas for three years with a monthly salary of 10,000 Brazilian reals ($4,080). However, for Cuban doctors, their wages will be sent through PAHO to Cuba, where the government will decide how much each doctor will receive.

Medical schools in Cuba graduate large classes every year, and free medical educations are provided to thousands of low-income students from around the world, including the United States. The Cuban government pays for each student’s education, which is around $10,000 to $15,000 a year, according to the Latin American Medical School’s Vice Rector Maritza Gonzalez Bravo. Cuba’s doctors have become increasingly instrumental for the country’s revenue since medical missions programs began in the early 1960s.

According to a Cuban Health Ministry official, 38,868 Cuban medical workers, including 15,407 doctors, were working abroad in 66 nations worldwide last year. Exporting medical services brings in an additional $6 billion each year to the Cuban economy, which more than doubles the $2.5 billion that tourism made for the country in 2011.

All foreign doctors will be required to spend three weeks studying Brazil’s public health system and master the Portuguese language, according to the Ministry. Health care in Brazil is funded by the government-run Ministry of Health, which is responsible for all public health and medical services and hospitals. However, because government hospitals are free, they are also often crowded, and the condition of medical equipment isn’t up to the same standard as it is at private hospitals.

The public’s discontent with the government-provided health system turned into massive street demonstrations, thus leading to the enactment of the More Doctors program in June. The first group of Cuban doctors is expected to arrive in Brazil this weekend for the preparation course. Overall, the Brazilian government anticipates spending 511 million reals ($209 million) from bringing the rest of the 4,000 doctors total by February 2014.

However, many homegrown doctors object to the Cuban recruit plan and believe it has the potential to do more harm than good for the country. Cuban doctors who cannot speak Portuguese have diplomas that are not up to the same standards and validity as Brazilian doctors’ medical degrees.

"Through this agreement with PAHO, we're going to expand the number of doctors in precisely those municipalities where there's greatest difficulty in bringing professionals," Health Minister Alexandre Padilha said Wednesday in a press release.