A renowned Boston medical center was ordered by a judge Tuesday to stop imposing extraordinary security measures on a Bucks County cancer patient and her husband, who have been sharply critical of Brigham and Women's Hospital.

The Massachusetts judge agreed with the couple, Amy Reed and Hooman Noorchashm, that the security was intended to intimidate them, and violated their right to free speech as well as the hospital's own policies.

Hospital officials declined to comment.

Reed, 42, an anesthesiologist at the University of Pennsylvania, and Noorchashm, 43, a cardiac surgeon at Thomas Jefferson University Hospital, have led a highly effective national campaign to ban a gynecological surgical device that Brigham doctors used to perform her hysterectomy two years ago. The tissue-slicing device, an electric morcellator, spread her hidden uterine cancer - a danger that they have since publicized.

The couple and their six children moved to the Philadelphia area last year to be near relatives, but Reed continues to receive some of her cancer care at Brigham, where her husband used to practice.

On Monday, Reed checked into Brigham for urgent surgery to remove part of a lung. It was her third recurrence of the aggressive cancer, called leiomyosarcoma.

Both she and her husband were searched at the hospital entrance, and he was required to be accompanied by a security guard.

The measures were ordered by Ron Walls, Brigham's executive vice president and chief operating officer. In an Oct. 29 letter emailed to Noorchashm, Walls promised to provide Reed "with the best possible care" - at the same time threatening him if he didn't comply with the security protocol.

"Please be advised that BWH is a private property," Walls wrote. "If you do not adhere to the protocol outlined above, you will not be permitted to enter the premises. Unauthorized entry is subject to arrest for trespassing."

While Reed was in the operating room, the couple's Boston lawyer, Thomas Greene, filed a complaint in Massachusetts Superior Court seeking a restraining order against Brigham for engaging in "retaliatory action."

The hospital responded by arguing in court papers that Noorchashm "has made repeated, pointed statements to numerous physicians and employees at BWH who have perceived these statements as threats."

Over the last two years, Noorchashm has sent scathing emails - shared with reporters - to physicians and leaders of Brigham, accusing them of irresponsible and unethical behavior in refusing to abandon the device. He has also sent scornful emails to other hospitals, medical groups, device manufacturers, regulators, and members of Congress.

The relentless activism has led the Food and Drug Administration and insurers to curtail use of the device, now estimated to worsen hidden uterine cancer in as many as one in 350 women who undergo a hysterectomy. The campaign also has prompted ongoing investigations by the Government Accountability Office and the FBI.

Noorchashm said in his court complaint that neither he nor his wife has ever threatened violence.

"BWH has no rational reason to believe Dr. Noorchashm will attempt to physically harm or verbally accost anyone while his wife is a patient," the complaint said. "BWH knows that the medical professionals who are treating Dr. Reed do not believe Dr. Noorchashm poses any threat to anyone at BWH."

In support of that contention, Suzanne George, one of Reed's oncologists, wrote in an email given to the judge: "I can state that in the many times I have cared for Amy, with [Noorchashm] at her side, I have never felt threatened or unsafe."

When Brigham could not present any evidence of a threat, Judge Elizabeth Fahey ordered the security measures lifted. Hospital attorneys notified Greene on Tuesday night that they would not fight the ruling.

On Wednesday, her throat sore and voice raspy, Reed reflected on her latest ordeal while driving back to Philadelphia with her husband.

"Forget about the legality, it was just atrocious," she said. "This whole security nonsense they sprung on us - we have no idea where it came from. It added an entire layer of stress I just didn't need. I was in tears. I was worried [being searched] was a preamble for them to kick Hooman out of the hospital. I thought, 'What will happen to me and my care without him?' "

Noorchashm has recently expanded his activism to push for reform of medical device regulation, which many experts have long seen as flawed and too lax. Recently, he has supported women who want the Essure sterilization implant taken off the market.

"There's a profound problem here," he said Wednesday. "The corporate side of medicine gets in the way of patient care."

Reed and Noorchashm are preparing a lawsuit against Brigham and its doctors alleging malpractice in connection with the power morcellation of her cancer, Greene said.