MEXICO CITY  An American contractor who United States officials said went to Cuba to deliver communication equipment to religious groups was sentenced Saturday to 15 years in prison by a Cuban court, the latest turn in a case that could trip up thawing relations between the countries.

The United States has portrayed the contractor, Alan P. Gross, 61, as a suburban Washington humanitarian who was merely bringing satellite telephone equipment, which could be used to bypass heavy Internet restrictions in Cuba, to the small community of Cuban Jews when he was detained in December 2009.

But Cuban authorities said American officials, who eventually acknowledged that Mr. Gross lacked a proper visa and was working on a secretive United States Agency for International Development, or Usaid, program to expand Internet access, must have known such equipment was barred in Cuba without a permit.

They accused Mr. Gross of being a spy, tried him and convicted him of taking part in “a subversive project of the U.S. government that aimed to destroy the revolution through the use of communications systems out of the control of authorities.”