Authorities said Saturday they were in control of an overcrowded state prison that had been seized the day before by armed inmates after a gunfight between rival drug gangs left 18 prisoners dead.

"They (prison authorities) have entered and the situation has been normalized," said Manuel Saade, spokesman for the Tamaulipas state government. "The penitentiary is calm."The day was marked by a number of conflicting reports. Police said early Saturday that after the gunfight the situation returned to normal at the facility just across the border from Brownsville, Texas.

But officials changed their story later and said inmates still controlled the prison and Mexican army and police units had surrounded it.

Late Saturday, officials said authorities, including the state's attorney general, the head of the state judicial police, had entered the prison at about 10 a.m. and regained control.

Army and navy units that surrounded the prison did not enter, Saade said. He said the most dangerous prisoners would be transferred elsewhere.

The violence began Friday afternoon - on family visiting day - when an unidentified inmate tried to kill drug trafficker Oliverio Chavez Oraujo, known as the "cocaine czar," in a dispute over the control of drug dealing inside the prison, officials said.

The ensuring gunbattle of more than three hours killed at least 18 prisoners and seriously wounded seven, officials said. Local newspapers said 19 prisoners were killed and 40 to 50 wounded. All those killed or wounded were inmates, authorities said.

Among the 1,249 inmates are 30 U.S. citizens, but officials said no Americans were among the dead or wounded.

The inmate who shot at Chavez was "lynched" by other inmates, said Cesar de la Garza Garcia, chief of the state judicial police. He could not say if the man was killed.

Chavez, 29, was treated for wounds inside the prison, Saade said. But neither he nor seven of his supporters who were wounded would allow themselves to be transferred to an outside hospital for treatment for fear of attempts on their lives, Saade said.

The prison near Matamoros, 435 miles north of Mexico City, has a capacity of 240, but houses 1,249 prisoners, most of them drug and arms traffickers.