TRIPOLI, Libya - Gunmen tried to kill the head of the Libyan army Saturday in a bold daylight attack in the country's capital, setting off hours of intense gun battles along the main highway to the airport. Assailants in Tripoli also attacked one of Libya's largest military bases.

The gunmen were believed to be from renegade groups of former rebel fighters. The violence heightened concerns about unity among the ex-rebels - many of who remain heavily armed - while the police and military struggle to restructure their forces after the overthrow of Moammar Gadhafi.

Military officials said revolutionary fighters from the western mountain town of Zintan were likely behind the violence. They spoke on condition of anonymity because an investigation was still under way.

The violence began in the morning with the attack on the army chief of staff's convoy as it moved from his home in Tripoli to the military headquarters, said a military spokesman, Sgt. Abdel-Razik el-Shibahy.

A group of armed men at a mock checkpoint tried to stop them, but Gen. Khalifa Hifter's convoy swerved from the checkpoint and drove over a nearby bridge where it was shot at by two gunmen on the other side, Shibahy said.

The military spokesman said that no one in the convoy was harmed and that soldiers arrested the two gunmen, who were in military custody for questioning.

Minutes later, a second army convoy heading down the same road was ambushed, apparently by the same group of gunmen at another phony checkpoint. Soldiers firing AK-47s wounded two gunmen, Shibahy said.

Hifter's predecessor, military chief Abdel-Fattah Younis, was killed in late July. At the time, rebels insisted it was the work of Gadhafi's regime, but several witnesses said Younis was killed by fellow rebels.