RIYADH, Saudi Arabia -- A Saudi Arabian Airlines flight suffered a landing gear failure and was forced to make an emergency landing in the city of Medina early Sunday that injured 29 onboard, aviation officials in the kingdom said.

The accident happened after a technical failure prevented the crew from lowering the rear wheels on the right side of the Boeing 767-300, General Authority for Civil Aviation spokesman Khaled bin Abdullah Khaybari said in a statement to the official Saudi Press Agency.

The airline confirmed the account in a separate statement, saying that one of its leased aircraft had "a minor accident." Saudi Arabian Airlines, also known as Saudia, is the desert kingdom's national carrier and operates a fleet of more than 100 aircraft.

"Saudia expresses its deep sorrow to all the injured passengers as a result of the accident and prays to Allah the Almighty that He may provide them with a speedy recovery," the airline said.

The flight was carrying 315 people from the northeastern Iranian city of Mashhad, including 16 crew members.

Fire and rescue teams were deployed at Medina's Prince Mohammed bin Abdulaziz International Airport after the crew reported the landing gear problem and preparations were made for an emergency landing, Khaybari said.

The injuries happened during a stampede as passengers scrambled to evacuate the plane, Khaybari said. Most of those hurt suffered only minor injuries, though 11 were taken to the hospital for treatment, he said.

The airline reported that 12 passengers were taken to hospital, and that three remain in unstable condition. It did not elaborate.

Versions of the Boeing 767, a twin-engine, wide-body jet, have been in use for more than three decades.

Boeing expressed its concern for those who were on board the flight.

"Boeing is prepared to provide technical assistance at the request of Saudi Arabian civil aviation authorities or the U.S. National Transportation Safety Board," the plane maker said in an emailed statement.

The western city of Medina is the burial site of the Prophet Muhammad and is Islam's second holiest city after Mecca.

All flights to the city have been halted for 24 hours, according to the airline. It has formed a committee to track the condition of affected passengers.

The accident happened just hours before U.S. Secretary of State John Kerry was expected to arrive in Saudi Arabia for talks with King Abdullah.