WASHINGTON -- A federal judge on Thursday called a halt to genital pat-downs of Guantanamo Bay detainees who are meeting with attorneys.

In a sharply worded rebuke, U.S. District Judge Royce Lamberth said the intrusive search policy "flagrantly disregards the need for a light touch on religious and cultural matters."

Lamberth added that the searches undermine President Barack Obama's own declarations. "The search procedures discourage meetings with counsel and so stand in stark contrast to the president's insistence on judicial review for every detainee," Lamberth wrote. "The court, whose duty it is to call the jailer to account, will not countenance the jailer's interference with detainees' access to counsel."

Lamberth's 35-page opinion also will allow detainees who are weak due to hunger strikes to meet with their attorneys in their housing camps, instead of being transported to a central facility. It mandates that detainees who are transported must be given enough space to sit upright.

The ruling came as a surprise at U.S. Southern Command in Miami, where Marine Gen. John F. Kelly has oversight of the Guantanamo prison. Army Col. Greg Julian, a spokesman, said the "chain of command including Gen. Kelly will review the procedures to figure out how to accommodate the ruling."

Julian defended the searches as a necessary security measure following last year's suicide by overdose of a Yemeni detainee, Adnan Latif. From Dubai, Latif's attorney, David Remes, said the judge's order was "a great opinion. The government didn't just lose but actually lost ground." He was on his return to the United States from meeting families of Guantanamo detainees in Yemen.

"It will certainly ease the burdens we've been facing on access," said Pardiss Kebriaei, a senior staff attorney with the Center for Constitutional Rights, which is among the groups representing Guantanamo detainees.

Lamberth's ruling was the second judicial decision this week to spotlight the president's role in keeping Guantanamo open.

On Monday, in a separate case, U.S. District Judge Gladys Kessler called the force-feeding of hunger-striking Guantanamo detainees a "painful, humiliating and degrading process." While Kessler said she was powerless to take action, she pinpointed Obama as "the one individual who does have the authority to address the issue."

Lamberth, likewise, put Obama front and center Thursday, as the 69-year-old Vietnam War veteran led off by citing the president's assertion May 23 that "judicial review be available for every detainee."

"This matter concerns whether the president's insistence on judicial review may be squared with the actions of his commanders in charge of the military prison at Guantanamo Bay," Lamberth wrote. "Currently, it cannot."

The ruling came as the prison described things as settling down into a peaceful Ramadan routine after a long period of turmoil.

Two captives quit their hunger strike, according to the military on Thursday, reporting the first decline this year in the prison camps food strike. No detainee threw bodily fluids at a guard for at least 24 hours, said Navy Capt. Robert Durand, and no soldiers tackled and shackled a captive to force him out of cell during the same time period.

Army commanders this week released 75 captives from 22-hour lockdown in their solitary cells, allowing them communal time to eat and pray together. And some did share a meal of lamb and rice in the week, said Durand, predicting the hunger-strike and forced-feeding figures would come down. Navy doctors designated 45 of the captives for twice daily nasogastric feedings, if they didn't voluntarily drink two cans of Ensure on their own -- and listed 104 captives as hunger strikers, down from an all-time high of 106.

Kebriaei said Thursday that she suspected the new genital pat-downs were "part of the campaign of the camp to break the hunger strike."

Under previous Guantanamo commanders, Lamberth recounted, guards searching the detainees had avoided touching their genital areas. This was designed to avoid showing religious or cultural disrespect. Search procedures changed in May with the arrival of a new commander.

"The guard will search the detainee's groin area "by placing the guard's hand as a wedge between the scrotum and thigh ... and using flat hand to press against the groin to detect anything foreign attached to the body,' " Lamberth said, quoting the new policy. "The guard uses a flat hand to frisk the detainee's buttocks to ensure no contraband is hidden there."

Each detainee, already guarded and shackled, has been searched this way up to four times each time he's met with an attorney, Lamberth noted. No contraband has been found.

"Searching detainees up to four times in this manner for every movement, meeting or phone call belies any legitimate interest in security given the clear and predictable effects of the new searches," Lamberth wrote. "The motivation for the searches is not to enhance security, but to deter counsel access."

As they successfully argued in the earlier force-feeding case before Kessler, Obama administration attorneys said Lamberth didn't have legal jurisdiction over the "conditions of confinement" at Guantanamo. Lamberth, though, sidestepped this by reasoning that he was ruling on the separate, narrower question of whether detainees' legal rights were being impeded.

Julian, the U.S. Southern Command spokesman, wondered how one federal judge could conclude that he had the authority to intervene just days after another federal judge had concluded the opposite.