A U.S. judge on Monday granted the unconditional release of John W. Hinckley Jr. effective in June 2022, 41 years after he shot President Ronald Reagan and three others outside a D.C. hotel.

The judge’s ruling came after the Justice Department agreed last week to end court and medical supervision of Hinckley, who was freed from a government psychiatric hospital to live with his mother in Williamsburg, Va., in 2016.

“At this point the ball is in Mr. Hinckley’s hands,” Assistant U.S. Attorney Kacie Weston said at a hearing Monday. “The government agrees if he continues to do what he is doing between now and June 2022, he would be granted his unconditional release.”

U.S. District Judge Paul L. Friedman said he will issue a written release order in coming days, which would take effect once Hinckley completes a final nine-month observation period.

“If he hadn’t tried to kill the president, he would have been unconditionally released a long, long, long time ago,” Friedman said. “But everybody is comfortable now after all of the studies, all of the analysis and all of the interviews, and all of the experience with Mr. Hinckley.”

In a statement, the Ronald Reagan Presidential Foundation and Institute said Monday that “it is saddened to hear of the decision.”

“Contrary to the judge’s decision, we believe John Hinckley is still a threat to others and we strongly oppose his release,” it said. “Our hope is that the Justice Department will file a motion with the court leading to a reversal of the decision.”

Hinckley’s unconditional release would end one of the nation’s most high-profile criminal cases involving an insanity defense.

Hinckley was 25 when he shot Reagan, White House press secretary James Brady and two others with six exploding “Devastator” bullets from a .22-caliber pistol. A federal jury found Hinckley not guilty by reason of insanity in 1982.

Outrage over the verdict in the March 30, 1981, shooting reshaped the insanity defense in courts across the country. The revelation that he had pulled the trigger to impress movie star Jodie Foster added obsession and celebrity to the case. And extraordinary television footage of the attack on the 40th U.S. president brought the event to millions of American homes.

Hinckley, 66, was released from St. Elizabeths Hospital in Washington in 2016 under a host of medical, travel and other conditions after Hinckley’s doctors and the court found he no longer posed a danger to himself or others. Earlier, in 2000, he had been granted staff-supervised trips in Washington with family, outings that were gradually expanded to allow several nights and then two weeks a month under close monitoring.

While on “convalescent leave” in recent years, Hinckley has been ordered to stay away from D.C.; people protected by the Secret Service; his victims; and the media. He was directed to engage in work or volunteer three days per week, carry a traceable phone and provide information about vehicles he was driving. His access to social media and the Internet was also restricted and subject to inspection, and he was barred from having weapons and consuming alcohol or illegal drugs.

In 2018, a judge noted there had been “no problems” with Hinckley’s conduct and allowed him to look into moving out of his mother’s house. The frequency of required court appearances and visits with his treatment team was also reduced.

In August 2020, Hinckley’s medical team with the D.C. Department of Behavioral Health expressed satisfaction with his compliance and began recommending his full release and the removal of all conditions.

Friedman was scheduled to hold a fact-finding hearing Monday about the recommendation, but it was reset Friday after the Justice Department agreed to move faster and authorize the June 2022 offer Hinckley and attorney Barry Wm. Levine accepted, the parties said Monday.

“His mental disease is in full, stable and complete remission and has been so for over three decades,” Levine said.

Weston said a government medical expert set one requirement: that it monitor Hinckley through two more transitions until next spring. His mother, Jo Ann Hinckley, 95, who became an advocate for mental health research and education, died July 30. The leader of Hinckley’s group therapy session may also be leaving this winter, Weston said.

Hinckley had prepared for his mother’s death for some time and dealt with it “quite well,” Weston said.

“Assuming everything is maintained the way [Hinckley] has and that he’s adapting and adjusting to changes,” Weston said, “[the government’s medical expert] too would agree that unconditional release in June 2022 is appropriate and that Mr. Hinckley would have met his burden [of proving] that he is no longer a danger due to mental illness.”

Levine said Hinckley wanted to express apologies and “profound regret” to his victims, whom he named.

“He apologizes to the Reagan family,” Levine said. “The president was a man of generous spirit and magnanimity. He apologizes to the family of Jim and Sarah Brady, whose lives were altered by what he did. He apologizes to the families of Secret Service Special Agent Tim McCarthy and Metropolitan Police Department Officer Thomas Delahanty. He apologizes to Ms. Foster.

“And he apologizes to the American people. Perhaps, perhaps it is too much to ask for forgiveness, but we hope to have an understanding that the acts that caused him to do this terrible thing were the product of mental illness.”

A medical examiner ruled Brady’s death in 2014 a homicide stemming from his gunshot wound. Sarah Brady, a longtime advocate for gun control, died in 2015 in Alexandria, Va. She and her husband were both 73 when they died.

Reagan’s children have responded differently to Hinckley’s gradual return to society. Patti Reagan Davis has opposed his release.

“For me, for my family, for Foster, the memory of that day will never fade,” Davis wrote Monday in an opinion article in the Post criticizing the decision. “You just have to live with the fear, and the anger, and the darkness that one person keeps bringing into your life.”

Michael Reagan wrote in 2016 that he was long angered by Hinckley’s acquittal but later wanted “to be more like my father and have a forgiving heart, not an angry heart.” On Monday, he posted on Twitter that his father forgave Hinckley and would approve, and therefore “so do I.”

Ronald Reagan, who died in 2004, forgave Hinckley and wanted to tell him in person — a move his doctors discouraged at the time, saying it could set back his treatment, according to Reagan’s children and a biographer.

Hinckley, who plays the guitar and paints, was allowed to release writings, artwork and music under his name in 2020 after previously being limited to doing so anonymously. He created a YouTube channel and worked at an antique mall before the pandemic.

It was time, Friedman said Monday, for Hinckley to “live out his life, interacting with other people, and do so productively, doing his art and doing his music . . . in his own piece of the world.”