TRIPOLI, Libya (AP) -- Chad's president and a rebel leader pledged during a meeting in Libya to end the fighting in their country and urged other rebel groups to lay down their weapons.

President Idriss Deby and Mahamed Nour, the leader of the rebels who attacked Chad's capital in April, pledged Sunday to make peace during a meeting hosted by Libyan leader Moammar Gadhafi.

Libyan state television showed footage of the politicians gathered round a fire in a tent draped with green fabric.

"We thank God for enabling us to reach this agreement," Nour told journalists. Nour leads the Chadian United Front for Democratic Change, which launched a failed assault on N'djamena in April.

Competition for power in Chad has intensified since 2004 when it began exporting oil.

Deby also declared his support for the cease-fire.

"I vow in front of Gadhafi and everybody that we will be committed to our obligations," Deby said. "I call on those who believe that weapons are the solution to join this agreement."

Gadhafi has acted as a mediator in several African conflicts in recent years.

"I am against any rebelliousness in Africa and carrying weapons should only be done against occupation, which has ended in Africa," he said.

"I hope that the raging fire in the African Horn will be extinguished," the Libyan leader added. "Goodwill must be stronger than the will to destroy."

A Libyan official close to the talks said the agreement includes an amnesty for members of the rebel group, the integration of former fighters into the military and provisions for the return of refugees.

The pact is scheduled to be implemented over three months, and other rebel groups have a month to sign on, the Libyan official said. He spoke on condition of anonymity because he was not authorized to speak to the press.

Since early November, about 300 people have been killed in attacks on more than 70 villages in eastern Chad near the Sudanese border, the United Nations has said.

The violence came after repeated warnings that the Darfur conflict in western Sudan could spill over and engulf the region where Chad, Sudan and the Central African Republic meet.

The governments of Chad and Sudan accuse one another of supporting each other's rebels. Each side denies the charges.

At least 350 people -- troops, rebels and civilians -- died in April during the rebel assault on N'djamena.