John W. Hinckley Jr., who doctors said still desires a "blissful union" with actress Jodie Foster but also wishes to rape and kill her, was committed indefinitely to St. Elizabeths Hospital yesterday. He is to remain there until he can convince a federal judge that he no longer is mentally ill and dangerous.

Hinckley, making his first appearance in court since a jury found in June that he was innocent by reason of insanity in the shooting of President Reagan, told Judge Barrington D. Parker, "I don't necessarily agree" with doctors at St. Elizabeths who found he is a danger to himself, Foster and anyone else who stands in the way of his "union" with her.

Nevertheless, Hinckley agreed not to raise any legal challenges to the findings in the doctors' report, or seek an immediate release from the hospital.

By law, Hinckley is entitled to return to court every six months to try to persuade Parker that he no longer is mentally ill and dangerous and therefore should be released from the hospital.

In an 18-page report that was unsealed by Parker yesterday, a panel of doctors said that interviews with Hinckley were filled with themes of Hinckley's killing Foster -- or raping and killing her -- and then killing himself, and that they would be "joined in heaven" through those acts. "In short, he has an unrealistic notion that through violence, a new love can emerge," the doctors said.

Hinckley's feelings for Foster -- for whom he has said he shot the president -- swing between her being "the most perfect girl to being something of a tormenter whom he must kill," the doctors said in their report.

Since the March 30, 1981, shooting, doctors said Hinckley has said "many times" that he regrets that he did not kill Foster and himself, which would have "freed him from his obsession."

Parker, in a court order committing Hinckley to St. Elizabeths, found that the hospital had shown by "clear and convincing evidence" that Hinckley suffers from a "severe, chronic mental disorder" and is now, and will be in the reasonable future, a danger to himself and others.

The doctors' report said that Hinckley now sees himself linked in history with Foster and that they will be an "international couple." He also believes that he has changed from an "insignificant fan to a notorious person" but that he is troubled and hurt that Foster has ignored him since the shooting, the doctors said.

Foster's presence dominated every interview, the doctors said, adding that Hinckley is attracted to her intelligence, fame and precocious nature, that he loves her intensely because of "the way she smiles, the way she parts her hair, and her personality."

"My life feels like a melodrama . . . There won't be a mediocre ending. I won't let that happen after all that I did," Hinckley said, according to the doctors.

The doctors said when they asked Hinckley if he was dangerous to Foster, he said "Not now; if released I would go the other way but in one or two years if things go on the same, no response from her, then I'll kill her."

Although Hinckley denies that he thinks seriously about suicide every day, the doctors said they believe he "retains a substantial capacity for suicide" and that he considers it "probable that he will be dead in several years."

Hinckley last week waived his right to the hearing before Parker, but prosecutors insisted, and Parker agreed, that Hinckley should appear in person in court to state that he would not raise any legal challenges to his commitment, particularly any claim that he had a right to a jury trial on that issue.

As a result of the jury's verdict that Hinckley was legally insane when he shot Reagan, Hinckley was immediately committed to St. Elizabeths for 50 days. During that time, doctors there were required by the court to evaluate Hinckley's current mental state to determine if he now is mentally ill and dangerous.

The hospital's 18-page report, accompanied by a two-page cover letter and hundreds of pages of medical records, were submitted to Parker on Aug. 2. Parker, who presided at Hinckley's two-month trial, has the final say, now and in the future, about whether Hinckley should be released from the hospital.

Hinckley's parents and his lawyers have said they would not seek Hinckley's release until he was well and no longer dangerous and none of them, including Hinckley himself, sought to challenge the hospital's determination that he needs continued in-patient treatment.

The doctors said that while Hinckley seems sorry for what he has done, he is not deeply remorseful about the shooting, in which he injured Reagan, White House press secretary James Brady, U.S. Secret Service Agent Timothy McCarthy and former D.C. Police officer Thomas Delahanty.

The doctors' report appeared to support testimony at Hinckley's trial from defense psychiatrists -- vigorously contested by the prosecution -- that Hinckley's attack on Reagan was a combination of murder and suicide, that his victims were incidential to his ultimate goal of a union with Foster, that his delusions about her guide his life, and that he is unable to see that his ideas do not stand up to reality.

A government psychiatrist testified that Hinckley's depression was no more serious than the blues suffered by air traffic controllers. The hospital's doctors, again paralleling the defense findings, said Hinckley has a major depressive disorder, that had been serious and longstanding but may now be in partial remission because of medication and hospitalization.