WASHINGTON (Reuters) - U.S. officials are discussing whether to withhold a portion of U.S. assistance to Egypt to protest Egyptian passage of a law that imposes restrictions on non-governmental organizations, a senior administration official said on Wednesday.

Officials have not reached an agreement on whether to proceed with a recommendation to President Donald Trump and his senior leadership, but there is a feeling that some action is necessary in reaction to the move by Egypt, the official told Reuters.

U.S. aid to Egypt has long been sacrosanct. Egypt is one of Washington’s closest allies in the Middle East, receiving $1.3 billion in U.S. military aid and about $200 million in economic assistance annually.

“We told them over and over again don’t do this, that they are putting at risk U.S. aid, but they did it anyway,” the official said. “We’re figuring out how to respond.”

The discussions involve cutting off a portion of American aid, not all of it, the official said.

The Egyptian law restricts NGO activity to developmental and social work and introduces jail terms of up to give years for non-compliance.

Egyptian lawmakers said the law was necessary to protect national security. The government has long accused human rights groups of taking foreign funds to sow chaos and several are facing investigation over their funding.

In May, when the law was issued after being ratified by President Abdel Fattah al-Sisi, U.S. senators criticized it. Senators John McCain and Lindsey Graham called it “draconian legislation” and they said the U.S. Congress should in response “strengthen democratic benchmarks and human rights conditions on U.S. assistance for Egypt.”

U.S. Senator Marco Rubio, a Florida Republican, and nine other senators sent Trump a letter on June 19 urging the president to press Sisi on the issue.

“The U.S. Congress will take the Egyptian government’s recent actions into consideration as we review our bilateral assistance to Egypt to ensure that the American people’s tax dollars are used appropriately,” the letter said.

U.S. President Barack Obama froze aid to Egypt for two years after Sisi, then a general, overthrew Islamist President Mohamed Mursi in mid-2013 after mass protests against Mursi’s rule.

Trump has been intent on rebooting the bilateral relationship with Sisi and building on the strong connection the two presidents established when they first met in New York last September.

Trump gave Sisi firm backing and vowed to work together to fight Islamist militants when Sisi visited the White House in April.