The Trump administration held secret meetings with rebellious military officers from Venezuela over the last year to discuss their plans to overthrow President Nicolás Maduro, according to U.S. officials and a former Venezuelan military commander who participated in the talks.

Establishing a clandestine channel with coup plotters in Venezuela was a big gamble for Washington, given its long history of covert intervention across Latin America. Many in the region still deeply resent the United States for backing previous rebellions, coups and plots in countries like Cuba, Nicaragua, Brazil and Chile, and for turning a blind eye to the abuses military regimes committed during the Cold War.

The White House, which declined to answer detailed questions about the talks, said in a statement that it was important to engage in “dialogue with all Venezuelans who demonstrate a desire for democracy” in order to “bring positive change to a country that has suffered so much under Maduro.”

But one of the Venezuelan military commanders involved in the secret talks was hardly an ideal figure to help restore democracy: He is on the U.S. government’s own sanctions list of corrupt officials in Venezuela.

He and other members of the Venezuelan security apparatus have been accused by Washington of a wide range of serious crimes, including torturing critics, jailing hundreds of political prisoners, wounding thousands of civilians, trafficking drugs and collaborating with the Revolutionary Armed Forces of Colombia, or FARC, which is considered a terrorist organization by the United States.

U.S. officials eventually decided not to help the plotters, and the coup plans stalled. But the Trump administration’s willingness to meet several times with mutinous officers intent on toppling a president in the hemisphere could backfire politically.

Most Latin American leaders agree that Venezuela’s president, Maduro, is an increasingly authoritarian ruler who has effectively ruined his country’s economy, leading to extreme shortages of food and medicine. The collapse has set off an exodus of desperate Venezuelans who are spilling over borders, overwhelming their neighbors.

Even so, Maduro has long justified his grip on Venezuela by claiming that Washington imperialists are actively trying to depose him, and the secret talks could provide him with ammunition to chip away at the region’s nearly united stance against him.

“This is going to land like a bomb” in the region, said Mari Carmen Aponte, who served as the top diplomat overseeing Latin American affairs in the final months of the Obama administration.

Beyond the coup plot, Maduro’s government has already fended off several small-scale attacks, including salvos from a helicopter last year and exploding drones as he gave a speech in August. The attacks have added to the sense that the president is vulnerable.

Venezuelan military officials sought direct access to the U.S. government during Barack Obama’s presidency, only to be rebuffed, officials said.

Then in August of last year, President Donald Trump declared that the United States had a “military option” for Venezuela — a declaration that drew condemnation from U.S. allies in the region but encouraged rebellious Venezuelan military officers to reach out to Washington once again.

“It was the commander in chief saying this now,” the former Venezuelan commander on the sanctions list said in an interview, speaking on condition of anonymity out of fear of reprisals by the Venezuelan government. “I’m not going to doubt it when this was the messenger.”

In a series of covert meetings abroad, which began last fall and continued this year, the military officers told the U.S. government that they represented a few hundred members of the armed forces who had soured on Maduro’s authoritarianism.

The officers asked the United States to supply them with encrypted radios, citing the need to communicate securely, as they developed a plan to install a transitional government to run the country until elections could be held.

U.S. officials did not provide material support, and the plans unraveled after a recent crackdown that led to the arrest of dozens of the plotters.

Relations between the United States and Venezuela have been strained for years. The two have not exchanged ambassadors since 2010. After Trump took office, his administration increased sanctions against top Venezuelan officials, including Maduro himself, his vice president and other top officials in the government.

The account of the clandestine meetings and the policy debates preceding them is drawn from interviews with 11 current and former U.S. officials, as well as the former Venezuelan commander. He said at least three distinct groups within the Venezuelan military had been plotting against the Maduro government.

One established contact with the U.S. government by approaching the U.S. Embassy in a European capital. When this was reported back to Washington, officials at the White House were intrigued but apprehensive. They worried that the meeting request could be a ploy to surreptitiously record a U.S. official appearing to conspire against the Venezuelan government, officials said.

But as the humanitarian crisis in Venezuela worsened last year, U.S. officials felt that having a clearer picture of the plans and the men who aspired to oust Maduro was worth the risk.

“After a lot of discussion, we agreed we should listen to what they had to say,” said a senior administration official who was not authorized to speak about the secret talks.

The administration initially considered dispatching Juan Cruz, a veteran CIA official who recently stepped down as the White House’s top Latin America policymaker. But White House lawyers said it would be more prudent to send a career diplomat instead. The U.S. envoy was instructed to attend the meetings “purely on listening mode,” and was not authorized to negotiate anything of substance on the spot, according to the senior administration official.

After the first meeting, which took place in the fall of 2017, the diplomat reported that the Venezuelans didn’t appear to have a detailed plan and had showed up at the encounter hoping the Americans would offer guidance or ideas, officials said.

The former Venezuelan commander said that the rebellious officers never asked for a U.S. military intervention. “I never agreed, nor did they propose, to do a joint operation,” he said.

He claimed that he and his comrades considered striking last summer, when the government suspended the powers of the legislature and installed a new national assembly loyal to Maduro. But he said they aborted the plan, fearing it would lead to bloodshed.

They later planned to take power in March, the former officer said, but that plan leaked. Finally, the dissidents looked to the May 20 election, during which Maduro was re-elected, as a new target date. But again, word got out and the plotters held their fire.

It is unclear how many of these details the coup planners shared with the Americans. But there is no indication that Maduro knew the mutinous officers were talking to the Americans at all.

For any of the plots to have worked, the former commander said, he and his comrades believed they needed to detain Maduro and other top government figures simultaneously. To do that, he added, the rebel officers needed a way to communicate securely. They made their request during their second meeting with the U.S. diplomat, which took place last year.

The U.S. diplomat relayed the request to Washington, where senior officials turned it down, U.S. officials said.

“We were frustrated,” said the former Venezuelan commander. “There was a lack of follow-through. They left me waiting.”

The U.S. diplomat then met the coup plotters a third time early this year, but the discussions did not result in a promise of material aid or even a clear signal that Washington endorsed the rebels’ plans, according to the Venezuelan commander and several U.S. officials.

Still, the Venezuelan plotters could view the meetings as tacit approval of their plans, argued Peter Kornbluh, a historian at the National Security Archive at George Washington University.

“The United States always has an interest in gathering intelligence on potential changes of leadership in governments,” Kornbluh said. “But the mere presence of a U.S. official at such a meeting would likely be perceived as encouragement.”

In its statement, the White House called the situation in Venezuela “a threat to regional security and democracy” and said that the Trump administration would continue to strengthen a coalition of “like-minded, and right-minded, partners from Europe to Asia to the Americas to pressure the Maduro regime to restore democracy in Venezuela.” U.S. officials have openly discussed the possibility that Venezuela’s military could take action.

On Feb. 1, Rex Tillerson, who was secretary of state at the time, delivered a speech in which he said the United States had not “advocated for regime change or removal of President Maduro.” Yet, responding to a question afterward, Tillerson raised the potential for a military coup.

“When things are so bad that the military leadership realizes that it just can’t serve the citizens anymore, they will manage a peaceful transition,” he said.

Days later, Sen. Marco Rubio, R-Fla., who has sought to shape the Trump administration’s approach toward Latin America, wrote a series of Twitter posts that encouraged dissident members of the Venezuelan armed forces to topple their commander in chief.

“Soldiers eat out of garbage cans & their families go hungry in Venezuela while Maduro & friends live like kings & block humanitarian aid,” Rubio wrote. He then added: “The world would support the Armed Forces in #Venezuela if they decide to protect the people & restore democracy by removing a dictator.”

In a speech in April, when he was still White House policy chief for Latin America, Cruz issued a message to the Venezuelan military. Referring to Maduro as a “madman,” Cruz said all Venezuelans should “urge the military to respect the oath they took to perform their functions. Honor your oath.”

As the crisis in Venezuela worsened in recent years, U.S. officials debated the pros and cons of opening lines of dialogue with rebellious factions of the military.

“There were differences of opinion,” said Aponte, the former top Latin America diplomat under Obama. “There were people who had a lot of faith in the idea that they could bring about stability, help distribute food, work on practical stuff.”

But others — including Aponte — saw considerable risk in building bridges with leaders of a military that, in Washington’s assessment, has become a pillar of the cocaine trade and human rights abuses.

Roberta Jacobson, a former ambassador to Mexico who preceded Aponte as the top State Department official for Latin America policy, said that while Washington has long regarded the Venezuelan military as “widely corrupt, deeply involved in narcotics trafficking and very unsavory,” she saw merit in establishing a back channel with some of them.

“Given the broader breakdown in institutions in Venezuela, there was a feeling that — while they were not necessarily the answer — any kind of democratic resolution would have had to have the military on board,” said Jacobson, who retired from the State Department this year. “The idea of hearing from actors in those places, no matter how unsavory they may be, is integral to diplomacy.”

But whatever the rationale, holding discussions with coup plotters could set off alarms in a region with a list of infamous interventions: the CIA’s failed Bay of Pigs invasion to overthrow Fidel Castro as leader of Cuba in 1961; the U.S.-supported coup in Chile in 1973, which led to the long military dictatorship of Augusto Pinochet; and the Reagan administration’s covert support of right-wing rebels known as the contras in Nicaragua in the 1980s. In Venezuela, a coup in 2002 briefly deposed Maduro’s predecessor, Hugo Chávez. The United States knew a plot was being hatched but warned against it, according to a classified document that was later made public. The coup took place anyway and the George W. Bush administration opened a channel to the new leader. Officials then backed away from the new government after popular anger rose against the coup and countries in the region loudly denounced it. Chávez was reinstated as president.

In the latest coup plot, the number of military figures connected to the plan dwindled from a high of about 300 to 400 last year to about half that after a crackdown this year by Maduro’s government.

The former Venezuelan military officer worries that the 150 or so comrades who have been detained are probably being tortured. He lamented that the United States did not supply the mutineers with radios, which he believes could have changed the country’s history.

“I’m disappointed,” he said. “But I’m the least affected. I’m not a prisoner.”