Not long before a major crisis ripped through the Middle East, pitting the United States and a bloc of Gulf countries against Qatar, Jared Kushner’s real estate company had unsuccessfully sought a critical half-billion-dollar investment from one of the richest and most influential men in the tiny nation, according to three well-placed sources with knowledge of the near transaction.

Kushner is a senior adviser to President Trump, and also his son-in-law, and also the scion of a New York real estate empire that faces an extreme risk from an investment made by Kushner in the building at 666 Fifth Avenue, where the family is now severely underwater.

Qatar is facing an ongoing blockade led by Saudi Arabia and the United Arab Emirates and joined by Egypt and Bahrain, which President Trump has taken credit for sparking. Kushner, meanwhile, has reportedly played a key behind-the-scenes role in hardening the U.S. posture toward the embattled nation.

That hard line comes in the wake of the previously unreported half-billion-dollar deal that was never consummated. Throughout 2015 and 2016, Jared Kushner and his father, Charles, negotiated directly with a major investor in Qatar, Sheikh Hamad bin Jassim al-Thani, known as HBJ for short, in an effort to refinance the property on Fifth Avenue, the sources said.

Trump himself has unsuccessfully sought financing in recent years from the Qataris, but it is difficult to overstate just how important the investment at 666 Fifth Avenue is for Kushner, his company, and his family’s legacy in real estate. Without some outside intervention or unforeseen turnaround in the market, the investment could become an embarrassing half-billion-dollar loss. It’s unclear precisely how much peril such a loss would put Jared’s or his family’s finances in, given the opacity of their private holdings.

HBJ, a former prime minister of Qatar who ran the country’s $250 billion sovereign wealth fund, is a billionaire and one of the world’s richest men. He owns a yacht worth $300 million called Al Mirqab, the same name he gave to the private investment firm that Kushner pitched. The former emir of Qatar summed up HBJ’s power with a quip: “I may run this country, but he owns it.”

HBJ ultimately agreed to invest at least $500 million through Al Mirqab, on the condition that Kushner Companies could raise the rest of a multibillion refinancing elsewhere. The negotiations continued long after the election, carried out as recently as this spring by Charles Kushner. “HBJ basically told them, we’re good for 500, subject to a lot of things, but mainly subject to you being able to raise the rest,” said one source in the region with knowledge of the deal. The talks were confirmed by two additional sources with knowledge of the talks. One of those sources claimed that the potential deal was not contingent on the rest of the money being raised and that the HBJ investment was on hold as the overall structure of the financing was reconsidered. None of the sources would agree to talk on the record about a private financial transaction that has until now remained a secret.

After the election, Kushner Companies found many more suitors interested in doing business, one of the sources, who is U.S.-based, said. One of the investors taking the deal more seriously in late 2016 and early 2017, the U.S. source said, was “Hamid bin what’s-his-name,” referring to HBJ. Top executives at Kushner Companies, the source said, “are dumb enough to not know that why they want to deal with them has nothing to do with the real estate. Around the New Year they were like, ‘LPs” — industry slang for limited partners, or investors — “are engaging more!’ It’s like, I wonder why?”

Or, perhaps, they know quite well what’s going on. The $500 million still left the Kushners far short, and to try to fill the financing hole, the company turned to China. An insurance firm there with close ties to the country’s ruling elite had been pursued for months, but, like the other investors, wasn’t truly interested in the deal until after the election. (A source familiar with the dealmaking said that the Kushners had been in discussions with HBJ since before Trump announced his candidacy in June 2015. When a potential deal with Anbang was first reported by the New York Times in January 2017, company spokeswoman Risa Heller said the talks began “well before the president-elect’s victory,” right around when he officially sealed the Republican nomination.)

White House spokeswoman Hope Hicks referred questions to Kushner Companies; a spokesman there declined The Intercept’s request for comment. HBJ declined to comment.

In March, the details of the talks between Kushner and the firm, Anbang, became public. Anbang would invest $400 million in the project and the Kushners would put up $750 million, and additional investors, of which The Intercept’s sources say HBJ was to be one, would contribute a total of almost $2 billion more, according to a document being shown to investors that was shared with Bloomberg. The investment would have fit a trend of increasing Qatari investment in New York City real estate: Qatar’s sovereign wealth fund, which HBJ used to run, has increased its investment in New York City real estate in recent years, and HBJ has a number of property investments in London and New York.

Anbang’s $400 million, plus $100 million from other investors, would flow to the Kushners, meaning the family would recoup the entirety of their initial $500 million investment, a startling turnaround given that the New York Times’s detailed analysis of the building’s woes found the Kushners’ investment was now essentially worthless.

Crucially, in addition to the cash investment, the deal called for Anbang to take out a $4 billion loan to finance the demolition of the current building and the construction of an 80-story Zaha Hadid-designed residential and retail tower in its place. (The total cost for the project would be around $7.5 billion.) Only a handful of companies in the real estate business, such as Blackstone and Brookfield, are big enough to secure a loan of that size, and to date they appear unwilling to take on the level of scrutiny the deal would bring, never mind offer terms as favorable as Anbang’s. Additionally, any borrower would have to get their loan from somewhere, and one dynamic stymying the deal may be that any bank that underwrote such a loan would face just as much scrutiny for their financial and political judgment as the investor they gave it to.

Anbang pulled out after the deal was criticized as a conflict of interest, given Kushner’s role in the White House. With Anbang, and its ability to secure a $4 billion construction loan, out, the Qatari condition wasn’t met, and the Gulf deal fizzled, according to a source in the region. That chain of events was disputed by a source who said the deal between HBJ and the Kushners wasn’t dead, but on hold as the deal’s mix of loans and equity was reconsidered.

The revelation of the half-billion-dollar deal raises thorny and unprecedented ethical questions. If the deal is not entirely dead, that means Jared Kushner is on the one hand pushing to use the power of American diplomacy to pummel a small nation, while on the other his firm is hoping to extract an extraordinary amount of capital from there for a failing investment. If, however, the deal is entirely dead, the pummeling may be seen as intimidating to other investors on the end of a Kushner Companies pitch.

The crisis dates to May, when President Trump visited Saudi Arabia and met with regional leaders there, laying his hands on the now-famous orb. The Emir of Qatar met with Saudi King Salman, a high-level Qatari source told The Intercept, and it went well. “The Emir was in Jeddah before the summit, had a meeting with King Salman. King Salman did not bring up any subject about differences with Qatar,” he said. “After the summit, the Saudis and the Emirates, they thought, after signing all these contracts, they can have the upper hand in the region and they don’t want any country not to be in the same line.”

Whatever the reasoning, on June 5, a diplomatic crisis broke out, as Saudi Arabia and the UAE, along with Egypt and Bahrain, downgraded ties with Qatar, citing Qatar’s funding of terrorist organizations. Weeks earlier, the same countries blocked a number Qatari-backed media outlets citing derogatory public comments by the Emir, which Qatar insisted were fabricated and the result of a hack.

The blockade continued. At a private fundraiser in late June, he aimed at Qatar again, this time mocking the pronunciation of the country’s name. “We’re having a dispute with Qatar — we’re supposed to say Qatar. It’s Qatar, they prefer. I prefer that they don’t fund terrorism,” he quipped, according to an audio recording of his speech obtained by The Intercept.

The Kushners’ purchase of 666 Fifth Avenue for a record-breaking $1.8 billion in 2007 was a capstone to an era marked by high prices and reckless amounts of debt. The Kushners invested $500 million in the building, and took out debt to cover the rest. But even at the height of a bubbling New York real estate market, there were clear signs that the price was too high and the debt was too much. The Kushners paid $1,200 a square foot, twice the previous per square foot record of $600, while records show that even with the building initially almost fully rented out, revenue only covered about two-thirds of the family’s debt costs.

When the financial crisis hit, rents went down, vacancies went up, and the Kushners were short on cash to pay their debts. They sold off the Fifth Avenue retail space for $525 million and used the proceeds to pay off non-mortgage debt on the building. Then, in 2011, the Kushners sold off just under 50 percent of the building’s office space to Vornado, as part of a refinancing deal with the publicly traded real estate giant.

The $1.2 billion interest-only mortgage is due in February 2019. The office space is worth less than its mortgage and “there is no equity value” left in the office section of the building, Jed Reagan of Green Street Advisors told the New York Times in April. (Because they sold the retail space to make payments on other debt tied to the building, the office space is the only part of the tower the Kushners still have a stake in.) As a result, the family’s initial $500 million investment, once heralded as an example of Jared’s emergence as a brash real estate star, has for now effectively been wiped out. A massive refinancing and construction of a new tower that dramatically increases the building’s value is one way to try to get out of that hole.

The Kushners are also looking for loans totaling $250 million to pay off debt used to build an apartment building in Jersey City, Bloomberg first reported in June. The tower, called Trump Bay Street, was financed in part by Chinese investors. Those investments were made through the E5-B visa program, which gives green cards to wealthy foreigners in exchange for investments in the U.S. The family also owes CIT Group $140 million, which it must repay by September. A company spokesman later confirmed to the New York Times that it was indeed seeking the $250 million loan.

The Kushners came under fire in May when the New York Times reported that Jared’s sister Nicole Meyer had pitched her family’s ties as part of a roadshow to raise money for another Jersey City building under the same pay-for-residency visa program. After the report, the family backtracked and said they would not take part in the roadshow going forward.

Meanwhile, the water is rising on the Fifth Avenue investment. And the blockade continues.

Had the Qataris known where things were heading diplomatically, said the source in the region, they’d have happily ponied up the money, even knowing that it was a losing investment. “It would have been much cheaper,” he said.