TRIPOLI, Libya — Saddled with infighting and undermined by the occasionally ruthless and undisciplined behavior of its fighters, the six-month-old rebel uprising against Col. Muammar el-Qaddafi is showing signs of sliding from a struggle to overthrow an autocrat into a murkier contest between factions and tribes.

The increase in discord and factionalism is undermining the effort to overthrow Colonel Qaddafi, and it comes immediately after recognition of the rebel government by the Western powers, including the United States, potentially giving the rebels access to billions of dollars in frozen Libyan assets, and the chance to purchase more modern weaponry.

The infighting could also erode support for the rebels among members of the NATO alliance, which faces a September deadline for renewing its air campaign amid growing unease about the war’s costs and direction. That air support has been a factor in every significant rebel military goal, including fighting on Saturday in which rebel forces were challenging pro-Qaddafi forces in or near three critical towns: Brega, an oil port in the east, Zawiya, on the outskirts of Tripoli, and Gharyan, an important gateway to southern Libya. There were also clashes a few miles from the main border crossing into neighboring Tunisia, residents told Reuters.

While the rebels have sought to maintain a clean image and to portray themselves as fighting to establish a secular democracy, several recent acts of revenge have cast their ranks in a less favorable light. They have also raised the possibility that any rebel victory over Colonel Qaddafi could disintegrate into the sort of tribal tensions that have plagued Libya for centuries.