A former top Saudi intelligence officer and close U.S. intelligence ally has accused Crown Prince Mohammed bin Salman of targeting him for assassination and taking his children hostage because he has knowledge of damaging secrets about the prince’s rise to power.

In a federal lawsuit filed in Washington on Thursday, Saad ­Aljabri alleged “there is virtually no one Defendant bin Salman wants dead” more than him because of his relationship with the American government as “a longtime trusted partner of senior U.S. intelligence officials.”

Aljabri, living in exile in Toronto, is “uniquely positioned to existentially threaten Defendant bin Salman’s standing with the U.S. Government,” the lawsuit said.

In a detailed complaint running more than 100 pages, Aljabri alleges that the Saudi leader orchestrated a conspiracy to kill him in Canada that parallels one that resulted in the death and dismemberment of Jamal Khashoggi, the dissident Saudi columnist and Washington Post contributor. The CIA has assessed that Mohammed probably ordered Khashoggi’s killing himself, The Post previously reported.

Aljabri asserts the prince and his allies pressured him to return to Saudi Arabia, with Mohammed sending agents to the United States to locate him and having malware implanted on his phone. When Aljabri was ultimately located, Mohammed sent a “hit squad” to kill him, the lawsuit asserts. The team was stopped by Canadian customs officials, who, in a grisly echo of the Khashoggi case, were found carrying forensic tools that could have been used to dismember a corpse, Aljabri alleges.

Since March, Saudi authorities have arrested and held one of Aljabri’s sons, Omar, 22, and a daughter, Sarah, 20, the suit alleges. Aljabri’s brother has also been arrested, and other relatives detained and tortured in and out of Saudi Arabia, the lawsuit asserts, “all in an effort to bait [Aljabri] back to Saudi Arabia to be killed.”

A spokesman for the Saudi Embassy in D.C. did not respond to a request for comment. Some of Aljabri’s allegations have previously been reported by The Post and the New York Times.

Such explosive claims from a once-high-ranking Saudi official, whom the CIA credits with helping save American lives from terrorist attacks, could further strain Washington’s battered relationship with Riyadh. After Khashoggi’s death in 2018, Democratic and Republican lawmakers once counted as stalwart allies of the kingdom have turned away from the young crown prince and threatened to upend decades of economic and security cooperation between the two countries.

Mohammed has sought to rehabilitate his standing on the world stage. He has benefited from the support of President Trump, who has refused to accept the CIA’s assessment that Mohammed probably ordered Khashoggi’s death. Trump has said the crown prince has assured him he had nothing to do with what the U.S. president has called “an unacceptable and horrible crime.”

Aljabri, represented by Jenner & Block, alleges in the lawsuit that Mohammed believes Aljabri “is responsible” for the CIA’s conclusion and sees him as an impediment to further consolidating his power in Saudi Arabia and with the U.S. intelligence community. Aljabri was a close aide to deposed crown prince Mohammed bin Nayef, who was perhaps the CIA’s most trusted ally in the kingdom. Mohammed ousted bin Nayef in 2017 in a move Aljabri says “appeared to receive political cover from President Trump.”

Current and former officials familiar with the CIA’s assessment in Khashoggi’s death, who spoke on the condition of anonymity to freely discuss sensitive information, said they were skeptical Aljabri had played such a key role, but did not doubt Mohammed might believe otherwise.

Several officials described Aljabri as a valuable partner to U.S. intelligence operations who modernized Saudi’s counterterrorism capabilities after the 9/11 attacks, cracked down on al-Qaeda in the kingdom and pursued it into Yemen. Aljabri has been credited for overseeing a network of informants who exposed a 2010 plot by al-Qaeda in the Arabian Peninsula to send bombs concealed in computer printer cartridges on American cargo planes bound for Chicago, saving hundreds of lives.

Those who have spoken on Aljabri’s behalf include Michael Morell, a former acting director of the CIA under President Barack Obama, and George Tenet, who served as CIA director during the Bill Clinton and George W. Bush administrations. Aljabri and bin Nayef also enjoyed a close relationship with former CIA director John Brennan, who was also a chief of station in Riyadh.

“In all of my years at CIA, but most especially when I served as Director of the CIA Middle East Division, I never worked with any foreign official who had a better understanding of counterterrorism than Dr. Saad,” said Daniel Hoffman, who retired from the agency in 2017. “He justifiably deserves significant credit for building the U.S.-Saudi counterterrorism partnership following 9/11 to the close partnership on which our national security so deeply relies today. He was key to disrupting numerous al-Qaeda plots, which would have caused significant destruction and casualties in the U.S.

Separately, in a July 7 letter to Trump, four senators called Aljabri “a close U.S. ally and friend” and said the United States had “a moral obligation to do what it can to assist in securing his children’s freedom.”

“The Saudi royal family is holding Sarah and Omar Aljabri as hostages,” Sen. Patrick J. Leahy (Vt.), ranking Democrat on the Senate Appropriations Committee, wrote with Sens. Marco Rubio (R-Fla.), chairman of the Foreign Relations human rights subcommittee, Tim Kaine (D-Va.) and Chris Van Hollen (D-Md.) “For a government to use such tactics is abhorrent. They should be released immediately.”

Foreign leaders are typically immune from civil suits in U.S. courts while in office. However, Aljabri sued under the Alien Tort Statute and a 1991 law called the Torture Victim Protection Act, which provides recourse in U.S. courts for violations of international law and for victims of “flagrant human rights violations,” including torture and summary execution abroad.

Leahy said the claims in the lawsuit, if true, illustrate “the propensity of the Saudi Crown Prince to commit the most heinous crimes to silence his critics. It’s long past time for the United States to treat the Saudi Royal Family as what it is, a criminal enterprise.”

The suit also names as defendants Bader Alasaker, who heads the prince’s private office and travels regularly to the United States; former Saudi officials linked to Khashoggi’s death; the prince’s MiSK Foundation, which Aljabri alleged deployed a network of agents to hunt him; as well as alleged agents and hit team members. The foundation did not immediately respond to a request for comment.

Aljabri’s son, Khalid, 36, a cardiologist who moved from Boston to be near his father in Toronto, said in an interview that his father has been an ally of the U.S. government since the 2001 terrorist attacks.

“His main goal was the safety of his beloved country Saudi Arabia and its allies,” his son said.

Aljabri stepped down in 2016 and “did not have any kind of experience working with the Trump administration,” Khalid Aljabri said, adding, “I think honestly the Trump administration has a role in resolving this whole situation and doing the right thing by securing the release of my siblings.”

In a letter Thursday responding to concerns raised by U.S. senators, the State Department called Aljabri “a valued partner” to the U.S. government and said it would work with the White House to resolve the situation “in a manner that honors Dr. Aljabri’s service to our country.”

“Any persecution of Dr. Aljabri’s family members is unacceptable,” Acting Assistant Secretary Ryan Kaldahl wrote.

He said the department has repeatedly requested Saudi authorities clarify the nature of his children’s detentions and “will continue to urge their immediate release, absent sufficient and compelling justification.”

Aljabri’s allegations also underscore strains in relations between Canada and Saudi Arabia. In August 2018, Saudi Arabia expelled Canada’s ambassador and recalled its own envoy from Ottawa and thousands of government-funded Saudi students after Canada’s then-Foreign Minister Chrystia Freeland called for the release of civil society and women’s rights activists arrested in the kingdom.

Canada imposed a moratorium on new arms-exports permits to Saudi Arabia, partly in response to Khashoggi’s killing. The halt was lifted this April, after Canada secured improvements to a highly secretive $10 billion contract to sell Riyadh light armored vehicles, although the current foreign minister, François-Philippe Champagne, told reporters then that Saudi Arabia’s human rights record “remains troubling.”

The suit asserts that on about Oct. 15, 2018, Canadian border officials intercepted a hit team from the prince’s personal mercenary group, known as the Tiger Squad, on their way to kill Aljabri, whom agents had tracked down there.

The alleged plot was foiled when Ontario airport customs officials became suspicious of the men, who initially claimed not to know each other, and then questioned them. A lawyer from the Saudi embassy was called, and Canada eventually deported all but one of the alleged hit team members.

Bill Blair, Canada’s public safety minister, said he could not comment on specific allegations currently before the courts, but said “we are aware of incidents in which foreign actors have attempted to monitor, intimidate or threaten Canadians and those living in Canada. It is completely unacceptable and we will never tolerate foreign actors threatening Canada’s national security or the safety of our citizens and residents.”

Saudi officials have accused Aljabri and bin Nayef of misspending billions of operational funds to enrich themselves and sympathizing with the Muslim Brotherhood.

In the lawsuit, however, Aljabri claims that over a 39-year government career, it was he who was privy to Prince Mohammed’s “covert political scheming . . . corrupt business dealings” and use of personal mercenaries.

“Few places hold more sensitive, humiliating, and damning information about Defendant bin Salman than the mind and memory of Dr. Saad — except perhaps the recordings Dr. Saad made in anticipation of his killing,” the suit asserted.

Amanda Coletta and Karen DeYoung contributed to this report.