WASHINGTON - John W. Hinckley Jr. will be released from a government psychiatric hospital more than 35 years after he attempted to assassinate President Ronald Reagan and shot three others outside the Washington Hilton on March 30, 1981, a federal judge ruled Wednesday.

Hinckley, 61, no longer poses a danger to himself or others and will be freed to live full-time with his mother in Williamsburg, Va., effective as soon as Aug. 5, subject to dozens of temporary treatment and monitoring conditions, U.S. District Judge Paul L. Friedman of Washington wrote.

If Hinckley adheres to all restrictions, they could begin to be phased out after 12 to 18 months, removing him from court control for the first time since he was confined to St. Elizabeths Hospital after the shooting, according to the order.

"After thirty-four years as an inpatient at St. Elizabeths Hospital, and in view of the foregoing findings, and the successful completion of over 80 ... visits to Williamsburg over the last 10 years, the Court finds that Mr. Hinckley has received the maximum benefits possible in the inpatient setting," Friedman wrote in a 103-page opinion. "The court finds by the preponderance of the evidence that Mr. Hinckley will not be a danger to himself or to others if released on full-time convalescent leave to Williamsburg under the conditions proposed."

If Hinckley relapses or violates the terms of his release, he could be returned to St. Elizabeths, the judge ordered.

The order limits Hinckley to a 50-mile radius of Williamsburg, Va., requires him to turn over information about his mobile phone and vehicles he will be driving, and bars him from tampering with the browser history of his computer, uploading any content to the Internet, or accessing social media without unanimous approval of his treatment team. It does not order him to wear an ankle-monitoring device.

The ruling ends the institutionalization of the one of the nation's most notorious mental health patients, whose case marked a watershed in the criminal justice system's handling of mental illness and gun violence. His case came at a crossroads of presidential history, violence and celebrity, with extraordinary footage of the attack on the 40th president beamed into the homes of Americans in television news accounts.

Hinckley was 25 when he wounded Reagan, press secretary James Brady, U.S. Secret Service agent Tim McCarthy, and D.C. police officer Thomas Delahanty with six exploding "Devastator" bullets from a .22-caliber pistol. All survived the attack, but Brady was left paralyzed by a shot to his head and spent years before his death in 2014 advocating for gun control.

Hinckley said he shot Reagan to try to impress Hollywood actor Jodie Foster, an object of his obsession after repeated viewing the film, Taxi Driver.

After an eight-week trial, a federal jury in Washington found Hinckley not guilty by reason of insanity in June 1982 of all 13-counts against him, setting off a sharp public backlash. The federal government and 38 states subsequently rewrote laws to raise the standard of proof required for the insanity defense, which is now rarely used and is even more rarely successful.

Over the decades, the federal court has received reports on the state of Hinckley's mental health, and the Secret Service continued to watch him closely as he spent more time outside the hospital, tracking him on more than 200 occasions in 2013 and 2014, according to information presented in court last year.

Since 2003, Hinckley's longtime attorney, Barry Wm. Levine, has argued to lift Hinckley's confinement citing evaluations by St. Elizabeths officials that he no longer posed a threat.

Hinckley and his family are under court orders not to speak with reporters but Levine said Wednesday that the judge's finding that Hinckley is not dangerous "should give great comfort to a concerned citizenry that the mental health system and the judicial system worked and worked well."

"Mr. Hinckley recognizes that what he did was horrific. But it's crucial to understand that what he did was not an act of evil. It was an act caused by mental illness," Levine said. "He is profoundly sorry and he wishes he could take back that day, but he can't. And he has lived for decades recognizing the pain he caused his victims, their families, and the nation."

Bill Miller, a spokesman for U.S. Attorney Channing D. Phillips of Washington, said the office was reviewing the judge's opinion and had no comment.

The Secret Service declined to comment.

Dan Bongino, a former Secret Service agent who served on two presidential details, criticized the ruling.

"Just because he hasn't acted up in a clinical environment in decades, doesn't mean he does not have a proclivity to act out violently when he's out of that setting," Bongino said.

Hinckley's release will put a significant burden on the agency to monitor Hinckley any time a president travels near Williamsburg, Bongino said, "There is no room for error on this."

The people whose lives were directly affected by the shooting had mixed reactions to Hinckley's pending release.

Reagan died in 2004 at the age of 93 after suffering from Alzheimer's for a decade. Two of Reagan's children, Ron Reagan Jr. and Patti Reagan Davis, have opposed release, saying they do not trust Hinckley because of his past deceptions.

Davis said Wednesday she was not surprised by the decision. Hinckley's release had seemed inevitable, she said, in light of his getting increasing periods of freedom over the years.

During a hospital visit with her father when he was recovering from the gunshot wounds, Davis said the former president told her that his "ability to heal depends on my willingness to forgive John Hinckley." Davis said she, too, believes in forgiveness, but disagrees with the decision to release Hinckley to his mother's home.

"Forgiving someone in your heart doesn't mean you let them wander around Virginia when they are still a manipulative, not-well human being," she said.

Reagan's eldest son, Michael Reagan, said he would defer to the court's judgment because of the many years of scrutiny.

Like his sister, Michael Reagan recounted how his father talked of forgiving Hinckley even before he returned to the White House from the hospital. With the long list of conditions put in place by the court, Michael Reagan said, "I think everybody is safe."

Medical examiners ruled Brady's death in August 2014 a homicide resulting from the wound in the shooting. Prosecutors declined to bring new charges, citing legal barriers including that a jury already had previously reached a verdict against Hinckley.

Then-Secret Service agent Tim McCarthy was also hit by one of Hinckley's bullets. Now a police chief in Orland Park, Ill., McCarthy said of the decision Wednesday:

"He murdered one man, almost killed the president of the United States, and shot two others. They better be right about they are doing."

Brady's family members could not be reached Wednesday. In a statement, Dan Gross, president of the Brady Campaign to Prevent Gun Violence, said that Hinckley's release would "only redouble our resolve" to expand background checks to all gun sales. The Bradys "refused to be victims or give in to anger or injury. They spent their lives fighting for strong, sensible gun laws," Gross said.

Prosecutors long had argued that Hinckley's release was a "calculated risk" given instances of deceptive behavior during even his limited trips away from the hospital, and the court adopted many government recommendations among 34 conditions.

Prosecutors had objected that twice in Williamsburg in 2011, when Hinckley told doctors he went to a movie, he instead went to a nearby bookstore and a fast-food restaurant. One of those times, a trailing Secret Service agent said that Hinckley briefly stood in front of a section of the bookstore that included several items about Reagan and the shooting.

Psychiatrist Raymond F. Patterson, testifying for the government during another of Hinckley's reviews, described what he deemed a troubling "sense of entitlement and a disregard for the rules" in January 2015, when Hinckley again deviated from plans, going with a photographer friend to an acquaintance's music recording studio instead of to another photographer's home.

Hinckley's therapists called that incident a matter of bad judgment and said he had not exhibited "risk factors" of a relapse, such as depression, isolation, interest in weapons, or an ego-boosting distortion of reality.

In his Wednesday order, Friedman, a 1994 Clinton appointee, continued many restrictions already in place for Hinckley's short stays at home and imposed others that all parties have agreed to for his release.

Hinckley is to continue weekly therapy in Williamsburg, return at least monthly for outpatient treatment in Washington, and volunteer or work three times a week. He must stay out of contact with the media, his victims, their families, the U.S. president, members of Congress, and Foster. He must abstain from alcohol and cannot possess a weapon.

During a hearing in the spring of 2015 over Hinckley's mental health, the psychiatrist Patterson said "the notoriety-fame issue is one that is part of [Hinckley's] pa­thol­ogy."

In addition to a ban on unapproved social media activity, Friedman ordered Hinckley to give his treatment team and, in turn, the Secret Service, access to all online accounts including email, and prohibited him from accessing online information for at least six months about his crime, victims, weapons, or hardcore pornography

In Wednesday's action, Friedman ordered Hinckley to give authorities access to his email account, barred him from setting up or posting on social media accounts — such as on Facebook.

Like his mother, Hinckley's siblings, Scott B. Hinckley and Diane Hinckley Sims, have pledged their full support in court filings and testimony. His mother has $500,000 in savings and home equity, enough to pay for about four or five years of Hinckley's living and medical costs at their current rate, or longer if he qualified for federal or state insurance or disability benefits or if his therapy needs decrease.

Hinckley had spent his time in Williamsburg volunteering at a local mental hospital and as a church groundskeeper, taking his mother to a Ruby Tuesday restaurant and for scenic drives, looking at music sites, and unsuccessfully seeking work at a Starbucks and Subway shop, according to testimony and court filings last year. His relationships with women, while an area of concern, have grown healthier, Friedman noted, as Hinckley tried to distance himself from one female friend because of her drug and alcohol use, supported another through her ongoing mental health difficulties while discouraging her from moving to Williamsburg, and "successfully handled" a "Dear John" breakup letter in another relationship.

Over time and amid setbacks it has been Friedman, who took over the case in 2001, who oversaw the lengthy process of reintegrating Hinckley into society, permitting slowly expanding trips under the close eye of federal prosecutors and wary neighbors.

In the most recent step to ease Hinckley into independent living, the court in December 2013 allowed Hinckley to spend the majority of each month at his mother's home across from the 13th hole in the golf development.

Hinckley has been required to abide by a prearranged itinerary, carry a trackable phone, and log daily activities, including unsupervised walks and short trips to places where he was expected.

On March 20, 2015, hospital officials recommended Hinckley's full-time release. Prosecutors did not oppose it outright, but sought tighter monitoring and reporting requirements and contingency planning for his family's support, warning than having "no plan B" could lead to a relapse.

Assistant U.S. Attorney Colleen M. Kennedy argued over seven days of hearings that Hinckley should "have no expectation of privacy" regarding his use of the Internet or wireless devices. Prosecutors insisted that Hinckley, who plays the guitar, paints, and expressed an interest in photography, not publicly display or perform his work.

Friedman barred Hinckley from performing music in public, or from exhibiting or publishing any material without explicit approval from his treatment team. While the judge's new order continues to require Hinckley to carry a trackable phone and keep a daily log, it does not order him to wear a tracking device, sticking to a position Friedman took last year when he sided with hospital officials who "adamantly" opposed such a tracker, calling it "stigmatizing ... for no reason" given Hinckley's low risk of flight.

"Mr. Hinckley has gone bowling, attended several lectures, attended outdoor musical concerts, and joined a local community center to exercise and take classes offered," Friedman noted in his order, adding that Hinckley was recently offered a paid job at a church and "also has made significant strides toward developing friendships in the community and displayed improved self-initiative."

About a half-mile away from Hinckley's mother's home in the Kingsmill development, neighbor Joe A. Mann has been outspoken against his presence in the community. Neighbors think very highly of Hinckley's mother, Mann said Wednesday, but the retired businessman plans to use the judge's decision to energize his friends and local networks to stay on alert in case Hinckley poses a problem.

"Bottom line, it's about security for my friends and family," said Mann, who has shared his views in newspaper columns and on his blog. "I don't know one single person who says, `Yeah, bring him on.' "

Younger people in Williamsburg -- home to the College of William and Mary -- for the most part didn't know about Hinckley's release and didn't recognize his name. If they did, they were unconcerned about any threat Hinckley might pose.

"He only ever shot one person," said Scott Walker, 36, on lunch break outside the Subway sandwich shop Wednesday afternnon with fellow employees from DataXstream. "He was targeting the president. I don't feel unsafe."

To experts, Hinckley's case continues to be an outlier, a "one-off", said Joel A. Dvoskin, past president of the American Psychology-Law Society.

The son of a wealthy oil and gas executive raised mainly in Dallas, Hinckley struggled with emotional problems in high school and eventually dropped out of Texas Tech University to become a songwriter in Los Angeles. By 1981, he had bought an arsenal of weapons and stalked Foster, then a student at Yale, after watching her in Taxi Driver at least 15 times.

"Jodie, I'm asking you now to please look into your heart and at least give me the chance, with this historic deed to gain your respect and love," Hinckley wrote in a letter found by police in his Washington hotel room after the 1981 attempted assassination of Reagan.

Early in his stay, Hinckley's diagnosing physicians at St. Elizabeths Hospital found there was no doubt that he was delusional and in the grips of a raging narcissistic personality disorder, according to court records, but said that he did not present classic or stereotypical signs of schizophrenia.

Yet Hinckley continues to personify and perpetuate popular misconceptions of mental illness and of links to gun violence, said Ron Honberg, senior policy adviser for the National Alliance on Mental Illness warned,

"The generalizations that have been made regarding Mr. Hinckley are almost always wrong. He's a pretty unique case in every respect," said Dvoskin, now a criminal justice expert at the University of Arizona. "What John Hinckley did, and the response to it, had a horrible effect on increasing the stigma of mental illness, and the false belief that people with mental illnesses are presumptively dangerous."