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 the U.S. considers a terrorist organization.

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 Venezue­la’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, Ma­duro’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.

“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 and his vice president.

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.