John Hinckley Jr., who tried to kill President Ronald Reagan, is set to be released from the mental hospital where he has been held for decades.

A federal judge ruled on Wednesday that Hinckley will be released and allowed to return home to live with his mother in Williamsburg, Va.

“Mr. Hinckley shall abide by all laws, shall not consume alcohol, illegal drugs… shall not possess any firearm, weapon, or ammunition and shall not be arrested for cause,” Senior U.S. District Judge Paul Friedman said, per NPR.

Also Read: Tim Matheson, Cynthia Nixon to Play Ronald and Nancy Reagan in 'Killing Reagan'

On March 30, 1981, Hinckley approached Reagan outside the Washington D.C. Hilton and fired at him six times. Reagan was not hit directly, but a bullet ricocheted off the Presidential limousine and struck Reagan in the chest, nearly killing him.

Reagan’s press secretary, James Brady, was shot in the head but survived. He remained wheelchair bound for the rest of his life. In addition, police officer Thomas Delahanty and Secret Service agent Timothy McCarthy were also wounded.

At his trial, Hinckley was found not guilty by reason of insanity and was sentenced to a mental health facility. Hinckley said that he tried to kill Reagan because he wanted to impress actress Jodie Foster.

Also Read: Alzheimer's Association Blasts 'Offensive' Reagan Dementia Comedy

He had become obsessed with her after viewing the movie “Taxi Driver” and carried out the assassination attempt when he failed to get in contact with her.