Turkey's parliament has approved a legislation allowing its troops to be deployed to a Turkish military base in Qatar.

The bill, first drafted in May, passed with 240 votes in favour, largely with support from the ruling AK party and nationalist opposition MHP.

Wednesday's decision is a show of support for Qatar as it faces diplomatic and trade isolation from some of the biggest Middle Eastern powers.

Qatar faces embargoes as biggest regional diplomatic crisis in years escalates

Turkey is a key ally of Qatar and is setting up a military base in the country which also hosts the largest US airbase in the Middle East.

Saudi Arabia, Egypt, the United Arab Emirates (UAE) and Bahrain severed relations with Qatar and closed their airspace to commercial flights on Monday, accusing it with financing "extremist" groups.

Qatar vehemently denies the accusations. This is the worst split between powerful Arab states in decades.

Turkish President Recep Tayyip Erdogan has criticised the Arab states' move, saying isolating Qatar and imposing sanctions will not resolve any problems and adding that Ankara will do everything in its power to help end the crisis.

Turkey has maintained good relations with Qatar as well as several of its Gulf Arab neighbours.

Turkey set up a military base in Qatar, its first such installation in the Middle East, as part of an agreement signed in 2014. In 2016 Ahmet Davutoglu, then Turkish prime minister, visited the base where 150 troops were already stationed, the Turkish daily Hurriyet reported.

In an interview with Reuters in late 2015, Ahmet Demirok, Turkey's ambassador to Qatar at the time, said 3,000 ground troops would eventually be deployed at the base, which was planned to serve primarily as a venue for joint training exercises.

What's behind the diplomatic breakdown in the Gulf?

Source: Al Jazeera and news agencies