By Alexander Cornwell

DUBAI, July 20 (Reuters) - The United States has ended a four month ban on passengers carrying laptops onboard U.S. bound flights from certain airports in the Middle East and North Africa, bringing to an end one of the controversial travel restrictions imposed by President Donald Trump's administration.

Riyadh's King Khalid International Airport was the last of 10 airports to be exempted from the ban, the U.S. Department of Homeland Security (DHS) confirmed in a tweet late on Wednesday local time.

Middle East carriers have blamed Trump's travel restrictions, which include banning citizens of some Muslim majority countries from visiting the United States, for a downturn in demand on U.S routes.

In March, the United States banned large electronics in cabins on flights from 10 airports in the Middle East and North Africa over concerns that explosives could be concealed in the devices taken onboard aircraft.

The ban has been lifted on the nine airlines affected -- Emirates , Etihad Airways, Qatar Airways, Turkish Airlines , Saudi Arabian Airlines, Royal Jordanian , Kuwait Airways , EgyptAir and Royal Air Maroc -- which are the only carriers to fly direct to the United States from the region.

A ban on citizens of six Muslim-majority countries -- Iran, Libya, Somalia, Sudan, Syria, and Yemen, -- remains in place though has been limited after several U.S. court hearings challenged the restrictions.

"The aviation industry has been trying to come together with a united message to governments and stakeholders about regulation and supporting the industry," said Will Horton, senior analyst at Australian aviation consultancy CAPA.

"That was dealt a first blow from the travel ban and then a second from the large electronics ban."

Leading industry group the International Air Transport Association (IATA) criticised the laptop ban as ineffective, as security experts argued that militants could travel to the United States via Europe or elsewhere where the restrictions didn't apply.

The restrictions were imposed as major U.S. carriers American Airlines Group , Delta Air Lines and United Airlines resumed their campaign against the Gulf carriers Emirates, Etihad and Qatar Airways by pressuring the new U.S. administration to renegotiate its open skies agreements with the United Arab Emirates and Qatar.

However, U.S. and Middle East officials said the campaign and the travel restrictions were not related.

U.S. officials lifted the ban after visiting the 10 airports in Egypt, Morocco, Jordan, the United Arab Emirates, Saudi Arabia, Kuwait, Qatar and Turkey over the past three weeks to confirm new security measures announced last month were being implemented.

On Thursday, the U.S. issued a revised directive to airlines around the world in response to requests that it clarify aviation security measures scheduled to start taking effect this week.

The new requirements include enhanced passenger screening at foreign airports, increased security protocols around aircraft and in passenger areas and expanded canine screening. They affect 325,000 airline passengers on about 2,000 commercial flights arriving daily in the United States, on 180 airlines from 280 airports in 105 countries.

Airlines that fail to meet the new security requirements could face in-cabin electronics restrictions.

The United Kingdom continues to enforce a similar in-cabin ban on electronics ban on flights from some Middle Eastern airports. Those restrictions apply to flights from Turkey, Lebanon, Jordan, Egypt, Tunisia and Saudi Arabia.

(Reporting by Alexander Cornwell; Editing by Michael Perry) ((Alexander.Cornwell@thomsonreuters.com;))