Kenya Airways pilots returned to work on Wednesday, after a court ordered them to end their days-long strike which had led to hundreds of flight cancellations and stranded thousands of passengers.

The strike, which began on Saturday, exacerbated the woes facing the troubled national carrier, which has vowed to "do everything possible to return to normalcy in the shortest time".

Hours after a Nairobi court ordered the pilots to return to work, the Kenya Airline Pilots Association (KALPA) said its members would "resume duty" by 06:00 am (0300 GMT) on Wednesday -- the deadline stipulated by the judge.

"The strike is off, we are back to work," a KALPA spokesperson told AFP Wednesday.

Despite the announcement, Kenya Airways' latest online update showed just 19 flights operating on Wednesday, fewer than the 26 scheduled the day before, although it said on Twitter that normal operations should resume by November 12.

Officials at Nairobi's Jomo Kenyatta International Airport said the airline was still struggling to clear the backlog from earlier flight cancellations.

"We have had several KQ flights on schedule today take off after the pilots resumed work," an official at the Kenya Airports Authority told AFP, using the shorthand airline code.

"Things are getting back to normal," he said.

Passengers at the airport told AFP they were cautiously optimistic after being forced to reschedule their travel plans because of the strike.

"My flight is now confirmed at 5:00 pm, I just hope they don't cancel again," said Eliud Okello, who was due to fly to the Kenyan lakeside city of Kisumu.

Another passenger, who only gave her name as Londiwe, told AFP: "I have had the worst experience on KQ during the strike for the past two days, but finally I have been told I will fly this evening.

"So I am just hoping the pilots will not go on strike again."

KALPA launched the walkout in defiance of a court injunction issued last week against the strike, prompting the government to threaten the pilots with disciplinary action.

In a breakthrough for the beleaguered airline, Justice Anna Mwaure on Tuesday ordered KALPA members to resume their duties "unconditionally" by 6:00 am Wednesday.

Kenya Airways, which is part-owned by the government as well as Air France-KLM, is one of the biggest in Africa, connecting multiple countries to Europe and Asia.

But it has been running losses for years, despite the government pumping in millions of dollars to keep it afloat.

- 'No disciplinary action' -

Mwaure also ordered the airline's management to allow the pilots "to perform their duties without harassing them or intimidating them and especially by not taking any disciplinary action against any of them".

Transport Minister Kipchumba Murkomen had urged the pilots and the airline's management to obey the court order.

"In the past three days, this strike has disrupted travel plans for over 12,000 customers... forced the cancellation of over 300 flights, and affected 3,500 other employees who were not part of it," he said.

The protesting pilots are pressing for the reinstatement of contributions to a provident fund and payment of all salaries stopped during the Covid-19 pandemic.

In a statement released Tuesday, the airline's CEO Allan Kilavuka said: "We commit to complying with the court's directions."

The airline and the government have accused the union of engaging in "economic sabotage", with Kenya Airways warning that the strike would lead to losses estimated at $2.5 million per day.

The airline was founded in 1977 following the demise of East African Airways, and flies more than four million passengers to 42 destinations annually.

It has been operating in large part thanks to state bailouts following years of losses.