Alan Gross, an American who was locked up in a Cuban prison for five years, has accused Sen. Bernie Sanders, I-Vt., of praising the communist dictatorship when he visited him during his time in captivity.

"He said, quote: 'I don't know what's so wrong with this country,'" Gross recalled to NPR.

BERNIE SANDERS DEFENDS FIDEL CASTRO'S SOCIALIST CUBA: 'UNFAIR TO SIMPLY SAY EVERYTHING IS BAD'

According to the outlet, the Democratic presidential hopeful made the remarks during a visit by a congressional delegation in 2014 and told Gross he didn’t understand why people criticized the country.

Gross, an American contractor, was arrested in Cuba in December 2009. He was distributing telecommunications equipment in Cuba on behalf of the U.S. Agency for International Development (USAID) when he was accused by the communist regime of spying and sentenced to 15 years in jail for attempting to subvert the revolution, a charge he always denied.

Sanders has long had something of a soft spot for the authoritarian regime, and caused fresh controversy last month when he said it was “unfair to simply say everything is bad” about Cuban dictator Fidel Castro.

"We're very opposed to the authoritarian nature of Cuba but you know, it's unfair to simply say everything is bad. You know? When Fidel Castro came into office, you know what he did? He had a massive literacy program. Is that a bad thing? Even though Fidel Castro did it?" Sanders told CNN.

In a resurfaced speech given at the University of Vermont in 1986, Sanders praised the socialist policies implemented in Cuba by the Castro regime and criticized bipartisan efforts in the U.S. to tamp down on Castro's spread of communism. He's also backed other authoritarian regimes, and once defended Mao-era China by claiming it had democracy "on the local level."

A source close to then-Sen. Heidi Heitkamp, D-N.D., who was on the delegation with Sanders, told NPR that Heitkamp remembered his disregarding the meeting with Gross and that an uncomfortable exchange occurred.

BERNIE SANDERS ONCE SAID MAO-ERA CHINA HAD DEMOCRACY 'ON THE LOCAL LEVEL'

It’s similar to what Gross remembers.

"Sen. Sanders didn't really engage much in the conversation," Gross said.

CLICK HERE TO GET THE FOX NEWS APP

He also said he took offense to what Sanders did eventually say.

"I just think, you know, it was a stupid thing for him to do," Gross told NPR. "First, how could he not have seen the incredible deterioration of what was once the grandeur of the pre-Castro era. And two, how could be so insensitive to make that remark to a political hostage — me!"

Fox News' Vandana Rambaran contributed to this report.