Cuba has freed a man who was jailed for denouncing food shortages in a widely viewed YouTube video and sent him instead to a psychiatric hospital for three weeks, a human rights group said on Wednesday.

Juan Carlos Gonzalez Marcos, known as Panfilo, was sentenced in August to two years in prison for the video which has been viewed more than 450,000 times since posted in April.

Instead, he has been sent to a psychiatric hospital for three weeks of treatment for alcoholism after which he is expected to be released, said Elizardo Sanchez, spokesman for the independent Cuban Commission on Human Rights.

It's a corrective decision very unusual for a government known for its rigidity, Sanchez said. He said it was likely the result of international public opinion.

The case became a hot issue for the Cuban exile community in the United States, where it was held up as an example of how Cuba's communist-led government quashes dissent.

In the YouTube video, an apparently drunken Gonzalez, 48, could be seen jumping into the frame, pushing away a person being interviewed about reggaeton and waving his arms.

What we need here is a little bit of 'jama,' he shouted, using a Cuban slang word for food.

We need food, we're hungry here. Listen to what Panfilo tells you from Cuba: food, he said.

Days later, a sober Gonzalez appeared in a second video, recanting all he had said. He said he had been visited by police and was concerned he would be arrested.

On August 4, he was detained by police, tried a week later in a Havana municipal court and sentenced to jail for two years for dangerousness, a crime listed in Cuba's penal code. An appeals court upheld the sentence in a September 10 hearing.

The video surfaced at a sensitive time in Cuba, where the economy has been battered by the global financial crisis and three damaging hurricanes last year.

President Raul Castro has called on Cubans to cut wastage, conserve energy and raise productivity.

(Editing by Jeff Franks and Anthony Boadle)