The Libyan leader, Muammar Gaddafi, has accepted a roadmap to a political solution to the deadlocked two-month-old conflict, South Africa's president, Jacob Zuma, has said in Tripoli.

Zuma, who led a five-strong African Union (AU) delegation to the Libyan capital, said he was optimistic that a settlement would be reached. The delegation, minus Zuma, who was leaving Libya on Sunday night, will travel to Benghazi today to present the plan to the rebel opposition leadership.

Referring to officials of the regime, Zuma told reporters inside Gaddafi's compound at Bab al-Azizia that "the brother leader delegation has accepted the roadmap as presented by us". He also called on Nato to stop air strikes on Libyan military targets "to give a ceasefire a chance".

Asked about the prospects of a deal, Zuma - who has had a close relationship with Gaddafi, said: "I am optimistic."

An AU official later said the plan included an immediate ceasefire, the delivery of humanitarian aid, the protection of foreign nationals in Libya, and dialogue between Libyan parties on the establishment of a transition period towards political reform.

He would not comment on whether the discussions with the Libyan leader had included the possibility of him relinquishing power. But, he added, "the AU considers it's up the to the Libyan people to choose democratically their leaders".

However, opposition forces insist they will not consider any deal that involves Gaddafi or his family retaining power.

Proposals put forward by the regime so far have included Gaddafi or one of his sons overseeing political change in Libya. It is far from clear how this gap could be bridged.

"The delegation ... will be proceeding to meet the other party, to talk to everybody and present a political solution to the problem in Libya," Zuma said. "We also ... are making a call on Nato to cease the bombings to give a ceasefire a chance."

The AU said it was speaking to "all partners" in the Libyan crisis, hinting at consultations with the US, Nato and European countries.

The AU delegation, consisting of the presidents of South Africa, Congo-Brazzaville, Mali and Mauritania, plus Uganda's foreign minister, landed at Tripoli's Mitiga airport after Nato gave permission for their aircraft to enter Libyan airspace. The planes were the first to land in Tripoli since the international coalition imposed a no-fly zone over the country more than two weeks ago.

Gaddafi later drove among the thousands of chanting supporters who gather daily at his compound to pledge their loyalty and act as a human shield against Nato airstrikes. Gaddafi's public appearances have become less frequent as the crisis has progressed.

The AU initiative came as Nato air strikes once again pulled the rebels back from significant defeat by stalling a government assault on the strategic town of Ajdabiya, the gateway to the revolutionaries' de facto capital, Benghazi.

Nato said its forces destroyed 11 tanks around Ajdabiya and 14 tanks on the outskirts of Misrata, the sole rebel-dominated town in the west of the country, which has seen fighting for about six weeks. "The situation in Ajdabiya and Misrata in particular is desperate for those Libyans who are being brutally shelled by the [Gaddafi] regime," said Lieutenant General Charles Bouchard, the Canadian commander of Nato's Libya operations.

A Red Cross ship docked in Misrata at the weekend, bringing medical supplies to civilians in the besieged port city, which is about 100 miles from Tripoli. The Libyan government has refused to take journalists into Misrata, citing safety, but civilians and doctors contacted by phone have described coming under attack from shells and sniper fire. Many of the victims are reported to be children. Last week Nato said Misrata was its "number one priority".

The air strikes in Ajdabiya, 90 miles from Benghazi, helped reverse days of setbacks for the rebels, during which Gaddafi's forces fought their way into the heart of the town on Saturday. Shelling around the southern entrance to Ajdabiya could be heard yesterday morning, but it died away in the afternoon following the air strikes. Six vehicles carrying government soldiers were hit. Their charred bodies were scattered around the still burning wreckage a few hours later.

"Nato has to do this to help us every single day. That is the only way we are going to win this war," one of the rebels, Tarek Obeidy, 25, told Reuters.

The rebels said government forces shot down a Russian-made helicopter sent into the fight by the rebels two days earlier. Nato forced a MiG jet fighting for the rebels to land. Many areas were deserted after civilians fled the prospect of Gaddafi's troops taking Ajdabiya for a second time in as many weeks.

Thousands of rounds of discarded bullet casings marked the site of some of the most intense fighting over the weekend.

The sudden change in the rebels' fortunes again demonstrated how reliant they are on Nato air strikes to hold off government assaults.

Nato faces humiliation if Gaddafi's army forces its way through Ajdabiya to threaten Benghazi, in defence of which Nato launched the air strikes. There is little sign of rebel defences there other than a line of artillery 15 miles from the city.

Libyan officials said the regime was preparing a new constitution, although they failed to give details or say whether Gaddafi would retain power. One official, Ibrahim Moukhzam, said: "Constitutions are not designed to fit around individuals. They are designed to serve the nation and any citizen can find a place for them in this constitution. Muammar Gaddafi as a Libyan individual can find his place in the constitution. The vast majority of people want him to stay. He is a symbol. He has many jobs and tasks."

Asked if it would be a presidential republic or another political system, Moukhzam said it would be a "Libyan version".

Meanwhile, four western journalists are believed to be in the custody after being detained near Brega, in the east of the country, last week, and a photographer for the Associated Press, who became separated from colleagues near Ajdabiya, has been found.