The Baladna farm is the most prominent example of Qatar's push for self-sufficiency.

Highlights Cows in this Doha dairy farm get hooked up to automated milking tubes

They get sprayed with cool water and go back to state-of-the-art barns

Cows, about 20,000 of them, rest on beds of cooled sand in these barns

Three times a day, the Holstein cows on this dairy farm north of Doha placidly step onto a circular platform to get hooked up to automated milking tubes.

Afterward, they get sprayed with cool water and go back to one of the 40 state-of-the-art barns where misting and cooling systems keep the summer temperature at roughly 82 degrees, well below the brutal 110 degrees it is outside on Qatar's scrubland.

The cows, about 20,000 of them, rest on beds of cooled sand. They do everything but yoga, joked Saba Mohd N.M. Al Fadala, the farm's public relations director highlighting the comfortable conditions.

Two years ago, none of this was here.

Qatar imported all its milk needs. But then neighboring Saudi Arabia and its regional allies declared they would blockade Qatar over disputes that included claims that Qatar supported Islamist factions such as the Muslim Brotherhood.

Newborn calves sleep on sand in open air cases beneath 40-foot high rooftops with fans at Baladna farm.

That left Qatar - rich in oil and natural gas - having to rethink how to get everything from construction materials to milk.

Now this farm, called Baladna, or "our country," and its five "milking parlors" provide enough milk for the domestic market in addition to making products such as cheese and yogurt. The company has even started exporting small amounts to Oman, Yemen and Afghanistan.

"This is one of the biggest successes since the blockade," said Adam Peffer, a Michigan native who has worked in Dubai and other countries before coming to Qatar to manage the dairy farm operations. "If there had been no blockade, this wouldn't be here. It shows the importance of food security."

The blockade has turned into a rallying cry for Qataris.

The Baladna facility in Al Khor, Qatar.

"The economy is getting stronger," said Yousef Al Horr, founding chairman of an environmental group, the Gulf Organization for Research & Development. He listed the new food industry, more direct supply routes and a boost for local logistic businesses tied to new port facilities.

"Now we have direct access to original suppliers and we're cutting out those middlemen," he said.

Overall, Qatar has adapted to the sanctions imposed more than two years ago by Saudi Arabia, the United Arab Emirates, Bahrain and Egypt. Those countries - angered by what they alleged was funding for extremist groups and support for Arab Spring movements - took direct aim at the Qatari economy and flagship brands such as Qatar Airways.

The sweeping diplomatic and commercial snub was an unprecedented move among gulf Arab nations that had usually tried to present a united front. But Qatar had increasingly faced regional pressures over its independent-minded polices and the growing clout of the Doha-based broadcaster Al Jazeera across the Arabic-speaking world.

Qatar also has the money to ride it out.

Qatar relies heavily on liquefied natural gas, which accounts for about 85 percent of its total exports. Those massive LNG exports, including production joint ventures with ExxonMobil and Royal Dutch Shell have continued unobstructed. In January, Qatar, which also produces only 600,000 barrels a day of oil, quit the Organization of the Petroleum Exporting Countries, or OPEC.

Employees transport cheese inside Baladna farm.

While President Donald Trump initially sounded sympathetic to Saudi complaints, the signals have changed. Qatar's leader, Sheikh Tamim Bin Hamad al-Thani, met the president in the Oval Office this month and discussed investments, circumventing the blockade in a rare break in U.S. support for Riyadh.

Qatar has "successfully absorbed the shocks" from a drop in oil prices from 2014 to 2016 and the Saudi-led boycott imposed in June 2017, the International Monetary Fund said in its spring assessment. Qatar's inflation-adjusted GDP growth is estimated at 2.2 percent, up from 1.6 percent in 2017, the report said.

S&P Global, which had changed Qatar's outlook to negative in 2017, has changed it back to stable.

Qatar has also rerouted much of its trade. Much of it previously flowed through Saudi Arabia - Qatar's only land border - or by sea through Dubai. Now, many ships to Qatar come from Turkey, India and Oman.

An employee is seen inside Baladna farm.

And Turkey, which made a deal last year with Qatar's central bank that helped stabilize the Turkish lira, is happy to boost trade, too.

The next World Cup, which will take place in Qatar in 2022, hangs over everything. There are more than $200 billion in major construction projects - eight new or renovated stadiums, a new metro system, and an entire new city on the northern edge of Doha. And Qatar has also fallen back on its sovereign wealth fund, which diverted about $20 billion of its roughly $320 billion of assets back into Qatar.

Many of the construction supplies for the stadiums, roads and metro projects no longer come from or through Saudi Arabia and the UAE. Instead, Qatar has activated backup plans that were part of its World Cup proposal. The Al Rayyan stadium, for example, was supposed to use steel from one of the boycotting countries and instead imported supplies from Oman.

To be sure, there have been bumps.

Because they must avoid Saudi airspace, commercial flights must take longer routes. That inconveniences the foreign workers who make up about 90 percent of the 2.7 million people here. The trip from Sudan's capital Khartoum to Doha, for example, doubled to almost seven hours. A consultant in Saudi Arabia must fly through Kuwait to visit relatives in Doha. He visits less often.

Baladna farm's products are on display in a restaurant on on its Al Khor, Qatar, campus.

Students from Bahrain, Egypt and Saudi Arabia who used to attend the more than a dozen U.S.-run university programs had to return home and most have not returned.

Yet enrollment went up at those Doha-based universities, which include Carnegie Mellon University, Georgetown University and Cornell University's medical school, among others.

"There is a lot of demand for U.S. degrees," said Konstantinos E. Kakosimos, associate professor of chemical engineering at Texas A&M University at Qatar.

Luckily for Qatar, it had just completed a port expansion project when the blockade was imposed, making it much easier to import directly from suppliers and to jump over regional logistics hubs in places such as Dubai or Saudi Arabia.

The Baladna farm is the most prominent example of Qatar's push for self-sufficiency.

When the blockade was announced, Qatar was able to get milking machines delivered quickly by paying an Irish company also seeking to buy the equipment to step aside for a rush order.

Then it airlifted cows from Europe using Russian cargo planes. Large numbers of those cows died of heat stress, but that was before the barns and cooling systems were completely constructed. The farm also has a 17-person veterinary team and hospital.

Since then, more cows have been imported from the United States and Canada. And 30 to 50 more cows are being born here every day.

To raise a hardy breed accustomed to relatively hot conditions, the newborns sleep on sand in open air cages beneath high rooftops with fans. They move to the barns after a year.

There are disadvantages to raising cows in Qatar, where the summer heat routinely tops 115 degrees. Cows can't be left outside to chew grass; there isn't any. Hay comes from places such as the United States, Spain, France, Germany and Romania.

In addition, Baladna uses a lot of water to cool the cows in a country that relies heavily on desalinization plants. Each cow uses 185 gallons a day of water for misting, so the farm reuses as much as it can.

The farm could use solar energy, but Kamel Abdallah, the Baladna chief executive, says that it's cheaper to use the subsidized 35 megawatts of gas-fired electricity on the grid.

The company is planning to sell a majority of the shares in a public offering later this year. That will be a test.

"Fifty percent of the job is to think past the blockade," said Abdallah. As a result, he is trying to build brand loyalty "very quickly." One tactic: Student groups visit during the school year.

He added, "Now we have the market to ourselves."

The dairy also hasn't solved the economic problem of getting Qataris to work in Qatar. People with Qatari origin account for barely a tenth of the 2.7 million people here. The privately owned Baladna enterprise has created 1,800 jobs - but the company just hired its first genuine Qatari employee, Al Fadala. The rest come from around the world.

The daughter of a diplomat, she studied life sciences in London, focusing on bacteria on fruits and flora. A few years ago, she started a business growing flowers.

"Previously I grew roses in the desert," she said. "Now I help grow cows in the desert. Nothing is impossible for us."