Two Iraqi refugees — likely in “grave danger” in their homeland because they or their families aided the American military — were detained at JFK Airport on Saturday under President Trump’s order restricting immigration from seven predominately Muslim countries.

One of the detainees, Hameed Jhalid Darweesh, 53, was released by midday, said US Rep. Jerrold Nadler (D-Manhattan).

“I suffered to move here, to get my family here …. I can’t go back,” Darweesh said shortly after his release. Asked if he’d be killed in Iraq, he answered: “Yes, yes.”

The fate of the other detainee, Haider Sameer Abdulkhaleq Alshawi, 33, was unclear.

Both men faced “grave danger” if they were forced to return to Iraq under Trump’s order, their lawyers said in court papers.

Their lawyers said the men’s detentions were the direct result of an order Trump signed on Friday calling for a temporary suspension of immigration and refugee resettlement from seven predominately Muslim countries.

Darweesh and Alshawi had each waited more than two years for approval to come to America, according to court papers.

Darweesh was an Army interpreter in Iraq — work that led some Iraqi militia groups to target him for death.

Alshawi’s wife and brother-in-law both worked in back office jobs with a US security contractor in Iraq. He was on his way to join his wife in the United States.

When lawyers trying to reach Alshawi early Saturday asked US Customs agents who they could speak to about the detention, an agent allegedly replied, “Mr. President. Call Mr. Trump.”

Darweesh was released just after 12:30 p.m., according to a tweet by Nadler, who was joined at the airport by Rep. Nydia Velazquez (D-Brooklyn).

Alshawi is still being held, according to Omar Jadwat, director of the American Civil Liberties Union’s Immigrant Rights Project.

“My understanding is that when Donald Trump signed the order there was no actual plan in place for how to implement it,” Jadwat told The Post.

The executive order imposes a 120-day moratorium on the refugee resettlement program and also proclaims that “the entry of nationals of Syria as refugees is detrimental to the interests of the United States.” It also calls for “extreme vetting” of those entering the United States from certain countries, and suspends for 90 days immigration from Iraq, Iran, Libya, Somalia, Sudan, Syria and Yemen.

The ACLU believes other people flying to Kennedy Airport, and other airports around the country, have been detained since the executive order was signed, but Jadwat could not provide specifics. Nadler said 10 other people are being detained at JFK.

The executive order also impacts legal permanent residents with green cards, a Department of Homeland Security spokeswoman told Reuters.

Darweesh, a married father of three, was heading to Charlotte, North Carolina with his wife and kids Friday night when he flew from Erbil, Iraq to JFK.

The rest of his family made it through customs. But agents stopped Darweesh, and refused to let him meet with lawyers for hours, according to a Brooklyn Federal Court filing seeking his release.

Darweesh spent a decade working as an interpreter, electrical engineer and contractor. He worked with the US Army’s 101st Airborne Division and the 91st Engineering Unit as well as federal contractors.

Darweesh was “directly targeted twice for his association with the US Armed Forces,” his lawyers said.

Baghdad Police, who are “widely known to be closely affiliated with anti-American militias,” searched his home; and sometime after that search was conducted, two of Darweesh’s colleagues “were killed as soon as they arrived to work,” according to the court filing.

Darweesh and his family fled from Baghdad to Kirkuk but the trouble followed in July 2009, when he was stopped at a market by a local shopkeeper who told him “that men were driving around in a BMW asking for [Darweesh] by name and the location of his house,” his lawyers said.

“These men returned a second time the following week, and Mr. Darweesh had strong reasons to suspect that the men searching for him were terrorist,” prompting the family to flee again, this time to Erbil, according to legal papers.

The Darweesh family applied for an Iraqi Special Immigrant Visa on Oct. 1, 2014 and were approved Jan. 20. They received the visas Wednesday and boarded their flight to the US Friday.

Tragedy had already touched the Alshawi family when he boarded his flight from Stockholm to New York Friday.

Alshawi’s wife was an accountant for federal contractor Falcon Security Group from 2006 to 2007; her brother was a human resources rep for the company.

Rumors began swirling that, “due to the family’s association with the US military, insurgents thought that they were collaborators,” according to court papers.

In 2010, Alshawi’s brother-in-law was nearly kidnapped; a month later, an car bomb killed some of Alshawi’s in-laws, according to court papers.

Alshawi’s wife and young son applied for refugee status in 2011 and settled in Houston in 2014, when she sought approval for her husband to join them. He was approved on Jan. 11.

Alshawi was supposed to get a connecting flight to Houston — but Customs agents wouldn’t even let him off the plane, his lawyers claim.

US Customs did not answer questions about the detention of the men Saturday afternoon.

with Post Wire Services