John Dore is off to Doha’s vast and luxurious Hamad International airport to greet the 8pm flight from Los Angeles via Liège, Belgium.

Wearing a straw hat with a small metal shamrock badge in homage to his Irish roots, his imminent visitors are neither family nor friends. Nor are they human at all, but rather a herd of 120 cows.

John Dore with a herd of cows.

A 58-year-old farmer from Co Kildare might seem an unlikely pivotal figure in a bitter dispute between the Gulf monarchies, but as the chief executive of the sprawling Baladna farm in the desert 60 kilometres north of Doha, Dore is a vital player in Qatar’s struggle for political survival.

Food security has become an essential goal for a country facing a land, sea and air boycott imposed in June by Saudi Arabia, the United Arab Emirates, Egypt and Bahrain. It is all part of a protracted and sprawling geopolitical dispute that has come to embrace the funding of terrorism, the hosting of the World Cup, the role of the Muslim Brotherhood, Iran and even the future of Middle East journalism.

Whether Qatar can withstand the boycott is a test of whether the tiny state’s previously booming economy can survive not just the physical blockade but also financial disinvestment by its Saudi and UAE neighbours. If the economy stays afloat, Doha’s chances of maintaining its independent foreign policy and forcing the Saudis into a slow, albeit disguised, retreat will be that much better.

Ramez al-Khayyat, vice-president of the Qatari company Baladna, stands on the grounds of his farm in the north of Doha. Photograph: Alamy Stock Photo

As the Doha skyline attests, Qatar is not a country that does things by half measures, and the Baladana farm’s large parent company, Power International Holding, is throwing money at the challenge. Previously dependent on Saudi Arabia for the bulk of its milk supplies, Qatar initially had to rely on the generosity of its remaining regional allies, particularly Turkey and Iran. Dore is importing cows from the US as fast as he can. He plans to supplement his existing herd of 4,000, which is capable of cornering 30 to 40% of Qatar’s milk market, with a further 10,000 by next summer – nearly enough to meet the milk needs of the country’s whole population of 2.3 million.

Thousands of cows are being transferred, each to their own pen in giant warehouses, where welders are still completing the railings. The sheds are cooled by giant fans and water sprays to stave off the sweltering heat and humidity.

The cows receive dry feed and are mechanically milked on state-of-the-art rotary machines capable of working 24 hours day. A viewing gallery allows curious Qatari families to watch the milking process. Elsewhere on the vast site stretching over 70 hectares (173 acres), scores of diggers are flattening the area ready to build more livestock sheds.

Qatar is also producing more of its own cereals. Photograph: Alamy

The whole process is more reminiscent of a car production line than a John Constable painting, but factory arable farming, which was conceived in arid parts of the US, is spreading rapidly across the Middle East.

“The boycott has been great thing for Qatar in a way,” Dore said. “It has been a wakeup call to the entire country. It has made them aware of all the opportunities that are there, and not just in farming. Nearly 80% of its food came from its neighbours. It sometimes takes war or the threat of war to make countries look at their food security. Look at the common agricultural policy in Europe.

“The people that have shot themselves in the foot are the Saudis. If the blockade was lifted, there is so much pro-Qatar sentiment and nationalist pride that the people will buy Qatar milk, not Saudi. I think the whole environment will completely change. Our challenge is to get enough milk. If we can make enough milk, the people in Qatar will buy it.”

Dore says his farm will be more productive than its Saudi counterparts, with a labour ratio of one person per 75 cows, as opposed to one per 45. His cows will also stand on rubber mattresses, and automated scrapers will remove their waste. “We are going to produce enough manure to turn Qatar green,” he said.

Self-sufficiency in food is only one test of whether Qatar can withstand the blockade and perhaps even emerge stronger, ready to receive tens of thousands of visitors to the 2022 World Cup.

An aerial view of fields in the Qatari desert. Photograph: Alamy

For all the country’s vast gas and fiscal reserves, the economy took an initial hit. The first few months saw panic and a significant outflow of capital deposits. Qatar Central Bank and other state funds quickly injected about $38.5bn (£29.2bn) of the country’s $340bn reserves into the economy to ease pressure on the exchange rate and cushion the impact of the disinvestment, according to a Moody’s report.

In other signs of pressure, despite a recent mini-revival the Doha stock exchange has been on a downward curve, reaching its lowest point in five years in September. GDP growth slowed to 0.6% in the second quarter compared with 2.5% in the first quarter, leading to a forecast that overall growth will be 2% for the year, the lowest since the 2008 financial crisis. Despite a skyline of cranes, property prices have slid by 4.7% over the past year, the biggest fall in five years.

Some of the slide precedes the boycott, but Yousuf Mohamed Al-Jaida, the head of the Qatar Financial Authority, says the entire region has inflicted damage on itself. “The GCC countries used to be the safest spot on the planet. Reputationally, it now looks different to global eyes. A lot of businesses had to re-profile their risk registers

“Qatar’s financial sector has stabilised, new ports, especially in Oman, have helped with the logistics, replacing Jebel Ali in Dubai … and crisis or no crisis, a slow down in growth was healthy at this point.

“For the past 15 years we were the fastest growing economy on the planet. You are talking about a $6bn economy in 2000 turning into a $200bn economy in 2015. But nothing fundamental has changed. So far we have not missed a shipment of energy. The blockading countries tried to make businesses decide between them and Qatar, but they backed away.”

Ali Shareef Al-Emadi, Qatar’s finance minister since 2003 and probably the most important politician in overseeing resistance against the blockade, explains: “It is not a secret that we have injected liquidity into the system. That was a precautionary measure, but we can think the market can absorb all this bad news. In terms of our liquidity and our currency, we see now the market is very stabilised.

“If you look by the second month of the blockade, the trade balance – imports and exports – was almost back to the pre-crisis levels. For one month, we had a 40% drop in imports, but we quickly adjusted. The whole country has shifted in less than a month so instead of relying on one set of countries, we have access to more than 80 countries. Food inflation is down. So despite all the pain that has come in terms of personal relationships, families, the fabric of the Gulf Cooperation Council, a lot of opportunity will arise from this for our economy. Look at tourism, the health sector, food security.”

Emadi says the economy will prove resilient because it has been ahead of other Gulf states in opening itself up to foreign investment.

“Qatar took the most difficult steps 20 years ago. It was investing in liquid gas, oil and gas industries and in utilities with international companies. We had Exxon Mobil here 20 years ago, not two years ago. At the time it was so difficult to get foreign firms to invest in our natural resources, even culturally it was a difficult thing to sell. We made the big investments in education.”

The boycott is now pushing Brand Qatar to open up further, liberalising its permanent residency laws, dropping visa requirements for 80 countries and cutting rents by half for many businesses.

The next plan is to establish the country as the place to do business for companies wanting to trade with Kuwait, Iran, Iraq, Pakistan and Oman. Jaida concludes: “There is a new era. We are determined to make this a blessing inside a calamity.”