All 20 Defense Department employees in the United State's Embassy's military group in Ecuador were ordered to leave the country by month's end, The Associated Press has learned.

The group was ordered to halt operations in Ecuador in a letter dated April 7, said embassy spokesman Jeffrey Weinshenker, the AP reported. The AP was first alerted to the expulsions by a senior Ecuadorean official who refused to be identified by name due to the information's sensitive nature.

Weinshenker said the military group had 20 Department of Defense employees, not all of them uniformed, and that Washington had provided $7 million in security assistance to Ecuador last year, according to the AP.

That $7 million also paid for technical training for maintaining aircraft and cooperation in combatting drug trafficking, human trafficking and terrorism, the AP reported.

In January, President Rafael Correa said he planned to order some to leave after publicly complaining in that Washington had too many military officers in Ecuador, claiming there were 50, and said they had been "infiltrated in all sectors," according to the AP.

Correa is popular at home for his poverty-fighting programs but widely criticized for stifling civil liberties and using criminal defamation law against journalists, the AP reported.

Weinshenker said U.S. military cooperation in Ecuador dates back four decades and that "all the activities we have carried out have had the explicit approval of our Ecuadorian counterparts," according to the AP.

U.S. relations with Ecuador have been strained in recent years, even before Correa provided asylum in 2012 to WikiLeaks founder Julian Assange, whose organization published troves of leaked U.S. military documents and diplomatic cables highly embarrassing to Washington, the AP reported.

Correa had previously expelled at least three U.S. diplomats including then-Ambassador Heather Hodges in 2011 in response to a cable divulged by WikiLeaks that suggested Correa was aware of high-level police corruption, according to the AP.

In November, Correa's government said it was asking the U.S. Agency for International Development to end operations in the country, accusing it of backing the opposition, the AP reported.

Shortly after first taking office in 2007, Correa purged Ecuador's military of officers deemed to have close relations with U.S. counterparts, also ending an agreement with Washington that allowed U.S. drug interdiction flights to be based at the Ecuadorean airfield in Manta, according to the AP.