John Hinckley Jr, the man who tried to assassinate US President Ronald Reagan, is to be released from a psychiatric hospital next month, after 35 years.
Mr Reagan and three others were injured in the shooting outside a hotel in Washington in March 1981.
Mr Hinckley was found not guilty by reason of insanity but was sent for treatment to a Washington hospital.
He has already been spending 17 days a month at his mother's home in Virginia under strict conditions.
A judge ruled that Mr Hinckley, now 61, could reside full-time there on "convalescent leave" from 5 August.
Restrictions, including a ban on talking to the media, will remain in place.
The shooting, just weeks into Mr Reagan's presidency, shocked the world.
Mr Reagan was shot in the lung, but recovered.
His press secretary, James Brady, was shot in the head, suffered brain damage and used a wheelchair for the rest of his life.
Mr Brady's death in 2014 at the age of 73 was ruled to be a homicide, but no further charges against Hinckley were brought.
Two law enforcement officers suffered less serious injuries in the shooting.
US District Judge Paul Friedman's judgement points to medical assessments which showed that Mr Hinckley had had "no symptoms of active mental illness" since 1983.
He had shot the president in an apparent bid to impress the actress Jodie Foster, with whom he had an obsession and whom he had subjected to what would now be termed stalking.
Ordering his release, the judge said Mr Hinckley no longer posed a danger to himself or others.
John Hinckley Jr's psychiatric history
The court order and opinion available on the website of the US District Court for the District of Columbia spells out the terms of Mr Hinckley's release and details his psychiatric history and treatment:
- He was diagnosed with acute psychosis, major depression and narcissistic personality disorder
- He has been in "full, stable and sustained remission" from the first two diagnoses for more than two decades, the court concluded
- The hospital believes further inpatient treatment is "not appropriate therapeutically" for Mr Hinckley's condition
- He is banned from contacting any of his victims, or their descendants, and Jodie Foster and her family
- He and his family are prohibited from talking to the media