WASHINGTON (AP) — More than 35 years after he tried to assassinate President Ronald Reagan in an effort to impress actress Jodie Foster, John Hinckley Jr. will be allowed to leave a Washington mental hospital and live full time with his mother in Virginia, a judge ruled Wednesday.

Judge Paul Friedman wrote in a 14-page ruling that Hinckley — who for more than a decade has been spending increased time outside the hospital and now lives 17 days a month at his mother’s home — is ready to live full time in the community. Friedman granted Hinckley leave from the hospital starting no sooner than Aug. 5.

Doctors have said for many years that Hinckley, 61, who was found not guilty by reason of insanity in the shooting, is no longer plagued by the mental illness that drove him to shoot Reagan. Three others were wounded in the March 30, 1981, shooting outside a Washington hotel, including Reagan’s press secretary, James Brady, who suffered debilitating injuries and died in 2014. His death was later ruled a homicide.

The shooting endangered Reagan’s life, but he recovered after undergoing emergency surgery. He died in 2004 at age 93.

Hinckley’s release from Washington’s St. Elizabeths hospital has been more than a decade in the making. In late 2003, the judge allowed Hinckley to begin leaving the hospital for day visits with his parents in the Washington area.

In 2006, Hinckley began visiting his parents’ home in Williamsburg, Virginia, for three-night stretches. That time has increased over the years so that for more than the last year he has been allowed to spend 17 days a month at the home, which is in a gated community and overlooks a golf course.

While outside the hospital, Hinckley has had to comply with a series of restrictions, and a number of those will continue now that he will be living full time in the community. He will have to attend individual and group therapy sessions and is barred from talking to the media. He can drive, but there are restrictions on how far he can travel. The Secret Service also periodically follows him.

Despite the restrictions, life in Williamsburg will likely be busy for Hinckley. The judge ordered him to volunteer or work at a paid job at least three days a week. He has sought out work and volunteer opportunities, but so far has been unable to secure employment. According to court records, he has said it was difficult for him to ask for jobs at Starbucks and Subway while being followed by the Secret Service: “It made me feel awkward and uncomfortable.”

According to court records and testimony at a hearing on the issue of his release, he has spent time volunteering at a church as well as a local mental hospital. He has attended meetings for people living with mental illness, talks at a local art museum and concerts. His hobbies include painting and playing the guitar and he has recently developed an interest in photography.

“I don’t like flipping around the TV, I want to do things,” a court document quoted him saying.

He also has said he wants to “fit in” and be “a good citizen.”

Hinckley will be required return to Washington once a month for doctors to check on his mental state and his compliance with the conditions of his leave, the judge ruled.

He also will be barred from speaking to the media or from trying to contact Foster, all relatives of Reagan and Brady or the other two victims, police officer Thomas Delahanty and Secret Service agent Timothy McCarthy, and their families.

Hinckley’s mother, Joann, is 90 years old. His father died in 2008.

Hinckley’s attorney, Barry William Levine, did not immediately return a message seeking comment Wednesday. William Miller, a spokesman for the U.S. attorney’s office in Washington, said the office is reviewing the ruling and has no comment.

___

Associated Press writers Sarah Brumfield and Jessica Gresko in Washington contributed to his report.

___

Follow Ben Nuckols on Twitter at https://twitter.com/APBenNuckols.