A Saudi Arabian Airlines passenger jet burst into flames on the ground at the airport here after an emergency landing late tonight, and officials said they feared all 265 persons aboard were dead.

Officials said it appeared that the 249 passengers and 16 crew members were trapped inside the flaming aircraft because rescue workers could not get the doors open.

It was the third-worst disaster in aviation history involving a single plane.

A communique issued here by the Saudi Directorate of Civil Aviation said the Lockheed L1011 Tristar had just taken off from Riyadh after arriving from Karachi, Pakistan, when the pilot reported a fire on board.

Officials from the national airline said by telephone from Riyadh that the airline flew back and made a successful emergency landing, but then exploded on a runaway. There was no indication of the cause of the fire or explosion.

The plane landed on the main runway and taxied to the end of an older runaway that is parallel to it.

As fire engines, ambulances and firefighting helicopters raced toward the plane, the pilot reported he was trying to send the passengers down the escape chutes, the radio said.

Contact was lost as fire engulfed the plane.

"As the tongues of flames shot out the windows of the plane, it became impossible to open the doors fromm outside or inside," a government statement said. "The whole plane was engulfed in flames."

According to the broadcast, the Saudi aviation directorate announced it was preparing messages of condolences to the families of the victims and that a detailed statement would be issued later.

Most of the passengers were Pakistani Moslems on a pilgrimage to Mecca, the birthplace of the prophet Mohammad in western Saudi Arabia, the Karachi office of the Saudi airline reported. The flight was destined for the Red Sea Port of Jeddah, considered the gateway to Mecca.

Security men barred civilians and reporters from the airport. Officials said a team of experts began an investigation to try to determine the cause of the fire.

It was not known if any Americans were on board.

Airline officials said Saudi King Khalid had been told of the disaster.

The aviation directorate said fire engines and special firefighting helicopters at Riyadh Airport fought the blaze but could not control it.

The Tristar is a wide-bodied jet powered by three engines. About 250 Tristars are in service with airlines throughout the world.

The version operated by Saudi Arabian Airlines can carry up to 400 passengers.

Last November, an Air New Zealand McDonnell Douglas DC10 crashed into a mountain in Antarctica, killing all 257 passengers and crew aboard.

On May 24, 1979, an American Airlines DC10 and 271 people aboard crashed on takeoff from Chicago, killing all passengers and crew and two people on the ground in the worst aviation disaster in the United States.

The world's worst airline disaster occured in 1977 on the Spanish resort island of Tenerife in the Canaries, when two Boeing 747s collided on the ground, killing 582 people.

The greatest loss of life in a single-plane accident was the crash of a Turkish Airlines DC10 northeast of Paris in March 1974 in which 346 people perished.