Aruba's government released a former Venezuelan general who was detained on U.S. drug charges when he arrived to serve as his country's consul on the Dutch Caribbean island, sending him home Sunday night and defusing a diplomatic fight with its neighbor.

Aruban authorities had argued previously that Hugo Carvajal, a former military intelligence chief, didn't have immunity from arrest because he had yet to be accredited by the Netherlands, which manages the foreign affairs of its former colony that sits off the coast of Venezuela.

But at a hastily called news conference in Aruba's capital, the island's justice minister said Carvajal was being let go because Dutch Foreign Minister Frans Timmermans decided Carvajal did have immunity, but also declared him "persona non grata" -- a term used by governments to remove foreign diplomats.

"The fact is that Mr. Carvajal was granted diplomatic immunity, but he is also considered persona non grata," Arthur Dowers told reporters at the news conference in Oranjestad that was streamed live on the Internet.

Shortly afterward, Venezuela's government announced that Carvajal had been freed and flew to Caracas with Deputy Foreign Minister Calixto Ortega.

President Nicolas Maduro thanked the Netherlands for taking a courageous decision to resolve the situation, which he said arose from false charges against Carvajal.

Dowers and Chief Prosecutor Peter Blanken said the decision to detain Carvajal on Wednesday was based on the fact that he while he had arrived using a diplomatic passport, he had no accreditation to serve as a diplomat on the island. They said officials decided to comply with the detention request from Washington based on an international treaty between the U.S. and the Netherlands.

"But that information changed today based on what Minister Timmermans of the Netherlands said. And Aruba has to follow instructions," Dowers said.

He said U.S. officials were "very disappointed" with the decision to free Carvajal, who was the highest-ranking Venezuelan official ever detained on a U.S. warrant. His arrest could further damage Venezuela's already fractious relations with Washington.

Carvajal served for five years until 2009 as the late President Hugo Chavez's head of military intelligence. The two met in the early 1980s at the military academy in Caracas and later took up arms together in a failed 1992 coup that catapulted Chavez to fame and set the stage for his eventual rise to power.

In 2008, Carvajal was one of three senior Venezuelan military officers blacklisted by the U.S. Treasury for allegedly providing weapons and safe haven to Marxist rebels in neighboring Colombia.

The Revolutionary Armed Forces of Colombia are classified a terrorist organization by the U.S. government. U.S. prosecutors have indicted all of the movement's top leadership, including senior commanders with whom Carvajal purportedly conspired, on charges of smuggling large amounts of cocaine.

Carvajal has denied any wrongdoing on those counts as well as charges unsealed this week in southern Florida that he was an associate of Wilber Varela, a major Colombian drug trafficker who was murdered in Venezuela in 2008.

The detention rallied supporters of Maduro's socialist government, who regularly accuse the United States of conspiring against it.

Maduro condemned Carvajal's arrest as a "kidnapping" orchestrated by the U.S., while Foreign Minister Elias Jaua said Sunday that the former general's only crime "is having defended the life of ex-president Chavez during 15 years."