A secret backchannel led by a veteran Republican Senate staffer and a flamboyant Venezuelan official nicknamed "Dracula" broke through hostile relations between the two governments to secure the release of American prisoner Joshua Holt, who traveled to the South American country for love and ended up in jail, without a trial, for two years.

A week ago the chances of Holt's long ordeal ending any time soon looked slim.

On the eve of Venezuela's May 20 presidential election, the Utah native appeared in a clandestinely shot video from jail railing against Nicolas Maduro's government, saying his life had been threatened in a prison riot. In retaliation, he was branded the CIA's spy boss in Latin America by the head of the ruling socialist party. Hours earlier Maduro expelled the top American diplomat over the refusal of the U.S. to recognize his re-election.

But the arrival in Caracas on Friday of Sen. Bob Corker, R-Tenn., chairman of the Senate Foreign Relations Committee, led to a surprise breakthrough. Maduro handed over Holt and his wife, Thamara Caleno, to Corker in what his government said was a goodwill gesture to promote dialogue and mutual respect between the two antagonistic governments.

Holt, 26, traveled to Caracas in June 2016 to marry a fellow Mormon he had met online while looking to improve his Spanish. The couple was waiting for Caleno's U.S. visa when they were arrested at her family's apartment in a government housing complex for what the U.S. considered trumped-up charges of stockpiling an assault rifle and grenades.

Although Corker sealed the deal in a few tense hours in Venezuela's collapsing, crime-filled capital, the push to secure Holt's release began months earlier by Corker's top Latin American policy aide, Caleb McCarry, who both Corker and Sen. Orrin Hatch, R-Utah, credited with leading the painstaking, behind-the-scenes negotiations.

McCarry leveraged a 15-year-old relationship with Maduro from their time together in the Boston Group, an informal gathering from across the political spectrum — Democrats, Republicans, socialists and capitalists — from both countries that worked discreetly to repair relations between the two countries following a coup in 2002 against then-President Hugo Chavez.

Relationships formed in the now-defunct group were also instrumental in securing the release of another American accused of spying, documentary filmmaker Tim Tracy, who spent a month in a Venezuelan jail in 2013.

McCarry secretly traveled to Venezuela in February to discuss Holt's imprisonment with Maduro and first lady Cilia Flores. The U.S. Embassy was kept at an arm's length, for fear of derailing the talks, although the initiative was backed by Undersecretary of State Thomas Shannon, who also knew Maduro from his days as political officer in Caracas at the outset of Hugo Chavez's revolution in the 1990s, several senior U.S. officials said.

Holding McCarry's hand throughout the delicate talks was "Dracula" — Rafael Lacava, the governor of central Carabobo state and a trusted ally of Maduro who also was close to the Boston Group members.

Holding McCarry's hand throughout the delicate talks was "Dracula" — Rafael Lacava, the governor of central Carabobo state and a trusted ally of Maduro who also was close to the Boston Group members.

Shortly after McCarry's visit, Lacava traveled to Washington in March to speak with several lawmakers including Hatch, Corker, Sen. Jeff Flake, R-Ariz., and Rep. Ed Royce, R-Calif., according to several senior U.S. officials. All the officials agreed to discuss details of the negotiations only on condition of anonymity.

However, after word of Lacava's visit was leaked by Sen. Marco Rubio, R-Fla., who has Trump's ear on policy toward Venezuela, the administration refused to meet with Maduro's envoy. Rubio warned that Lacava, who embraces the nickname Dracula for his habits of tweeting and patrolling around his state late at night in a Batmobile-like vehicle, was reportedly involved in money laundering, making him too toxic for a White House bent on punishing such criminal activity.

When The Associated Press reported on the politically fraught backchannel in March, few imagined it would succeed.

Speculation swirled that the government was demanding an all-but-impossible prisoner exchange for Flores' two nephews, who in 2016 were convicted in New York of drug trafficking, after it was learned that a government-connected Venezuelan tycoon was paying Holt's legal fees as well as those of the men branded the "narco-nephews."

At the same time, the Trump administration was intensifying a campaign to isolate Venezuela's government, sanctioning dozens of officials — including Maduro and Flores — for human rights abuses and drug trafficking while threatening a more crippling ban on oil shipments.

An official with the National Security Council stressed that nothing had been offered to secure Holt's release. President Donald Trump found out Friday that Holt would be released, said the official, who was not authorized to speak publicly and requested anonymity.

Secretary of State Mike Pompeo, while welcoming Holt's release, stressed that "U.S. policy toward Venezuela remains unchanged."

"The United States stands steadfast in support of the Venezuelan people and their efforts to return to democracy," he said in a statement.

"The United States stands steadfast in support of the Venezuelan people and their efforts to return to democracy." — Mike Pompeo, U.S. secretary of state

Alfredo Romero, a lawyer who defends some of the opposition activists who were held alongside Holt, said that Maduro may be looking to win over some political sectors in the U.S. to temper Trump's hardline approach toward Venezuela.

"Holt's continued imprisonment was a thorn in the side," he said.

The talks were encouraged by Pompeo, who met privately with Corker on Thursday morning and finalized details of the senator's trip ahead of testifying before the Senate Foreign Relations Committee on the State Department budget. "We're doing all the right things. We have an American there that we desperately want to get back, Joshua Holt. And so know that we are engaged," Pompeo told lawmakers at the hearing.

The government of Cuba was also helpful in pressuring Maduro as well as former Spanish President José Luis Rodríguez Zapatero, one official said. Zapatero has been leading a three-year push to bring the government and opposition together to help resolve Venezuela's economic and political crisis.

Still, when Corker left for Caracas on Friday it was still unclear if Maduro would follow through on his pledge to release Holt, the officials said.

On Saturday, a beaming Lacava could be seen in a video boarding the Venezuelan government plane that transported Holt to Washington wearing aviator glasses and a dark suit. He walked by the camera shouting "Dracula on the attack!" and flashing a "V for Victory" sign.

In a photograph taken at the airport in Caracas, Holt can be seen standing alongside Lacava holding a Venezuela national soccer team jersey emblazoned with the governor's name.

There was one last-minute scare. Taxiing down the runway, the plane suddenly slowed and its pilot turned back the craft to look into an instrument failure. When the once-unimaginable voyage resumed Holt had a big smile on his face, Corker told Trump in an Oval Office meeting Saturday night surrounded by the Utah man and his family.

"Probably the only time anybody was ever happy that there was a bad instrument on an airplane," said Trump.

Goodman reported from Bogota, Colombia. Associated Press writer Catherine Lucey contributed to this report.