A Muslim family from Long Island who were booted from the Empire State Building’s observation deck because they were praying has settled their lawsuit for an undisclosed sum, the Post has learned.

Fahad and Amina Tirmizi had said in their federal lawsuit that they and their two young children had begun silently reciting their evening prayers in a quiet spot on the 86th-floor deck at about 11 p.m. July 2, 2013, when two security guards roughly intervened.

The Farmingville couple was seeking $5 million in damages in the suit, filed last year in Manhattan federal court.

Although Amina briefly prayed with no hassle, a guard confronted Fahad and “menacingly poked” him as he told him he was not allowed to pray on the deck, the suit said.

Another guard arrived and told the family that they had to get out and “forcibly escorted” them down to the lobby and out of the building, the suit said.

“The Empire State Building has an unlawful [policy] that subjects Muslims to greater and/or heightened suspicion, security and/or surveillance compared to other religious and nonreligious individuals,” their suit said.

The Tirmizis’ lawyer, Philip Hines, declined to comment on the confidential settlement, which was confirmed in court filings.

The Empire State Building’s lawyer also declined to comment, citing the confidentiality agreement.

Reached as he was leaving his home with Amina, Fahad said, “I’m not allowed to talk about it.”

Speaking to The Post last year, he said he is respectful when he prays in public and had even done so earlier with a cop’s permission.

“We weren’t doing anything wrong. We just wanted to enjoy the view like everyone else,” he said.

“Earlier that same day at the Staten Island Ferry terminal, I needed to pray the afternoon prayer and wanted to make sure I’m not in the way.”