MEXICO CITY (Reuters) - Mexican state police rescued 165 migrants who had been kidnapped while traveling to the United States in the crime-ridden border state of Tamaulipas, authorities said on Thursday.

The migrants, mostly from Cuba, Honduras, and El Salvador, said they were beaten and in some cases sexually abused, the Tamaulipas state government said in a statement.

Some of the migrants, who had been held captive for up to three weeks, reported watching kidnappers kill a couple and their child, the state government added.

State police detained three men for the alleged crimes.

Tamaulipas, in northeastern Mexico, is a battleground between the Gulf Cartel gang and its ultra-violent rivals the Zetas, who are involved in migrant smuggling, though it was not clear whether the three men who were detained were associated with either group.

Migrants caught by the Zetas who refuse to smuggle drugs or work for the gang can pay for it with their lives.

The Zetas were blamed for the killing of hundreds of migrants found in mass graves in Tamaulipas in 2010 and 2011.

(Reporting by Lizbeth Diaz; Writing by Joanna Zuckerman Bernstein; Editing by Ken Wills)