In December 1979, in the midst of the Iran hostage crisis and Edward M. Kennedy's struggle to wrestle the Democratic presidential nomination from President Jimmy Carter, the Massachusetts senator dispatched former senator James Abourezk on a secret trip to Tehran to seek the release of the 52 American hostages there.

"I risked my life and my career," Abourezk said yesterday as he disclosed the unsuccessful mission, undertaken at a time when Kennedy's effort to reach the White House was suffering because of the hostage crisis.

The episode, which Kennedy confirmed through a spokesman, was disclosed by Abourezk in a letter chiding Joseph P. Kennedy II for returning Abourezk's $100 campaign contribution. Joe Kennedy is running for Congress in Massachusetts' 8th District.

A spokesman for Joe Kennedy, Edward Kennedy's nephew, said the contribution was sent back by an aide who believed it might be too controversial because Abourezk, who is of Lebanese descent, is chairman of the American-Arab Anti-Discrimination Committee, which takes a sympathetic view of the Palestine Liberation Organization.

Ironically, it was Abourezk's Arab background and ties to the Moslem community that led to his being asked to undertake the 1979 trip to Tehran by three associates of Edward Kennedy: then-Sen. John Culver (D-Iowa); Theodore Sorensen, an aide to John F. Kennedy; and Jan Kalicki, a foreign policy aide to Edward Kennedy.

At the time, Abourezk recalled yesterday in a telephone interview, Edward Kennedy's attempt to unseat Carter was in deep trouble, in part because the nation had rallied around the president in the early weeks of the hostage crisis. To make matters worse for Kennedy, he had been accused by Carter administration officials of endangering the hostages' lives by denouncing the shah of Iran.

"He had just finished making a statement about the shah being a jerk. Carter and his minions came down on him," said Abourezk, a Democrat who represented South Dakota in the Senate for one term, beginning in 1973.

Abourezk, who came to know Kennedy well through their work on the Judiciary Committee, said he did not ask to speak directly to Kennedy before going to Tehran. "It was better to give him an element of deniability," Abourezk said.

He said he spent "a few days" in Tehran, where he met with Iran's foreign minister, Sadegh Ghotbzadeh, who said, according to Abourezk: "We're going to have to try to release the prisoners . Kennedy is a good man."

Abourezk said the trip failed because Ayatolla Ruhollah Khomeini was not ready to release the Americans. The hostages were freed the day Carter left office -- Jan. 20, 1981.

An aide to Kennedy, James Wieghart, said the senator did not inform the White House of Abourezk's trip. In verifying Abourezk's account, Kennedy said he "had talked to a number of people and made a number of efforts" to gain the hostages' freedom, according to Wieghart.

In his letter to Joe Kennedy, released here yesterday, Abourezk wrote: "I think you know that I ran, and won, as a delegate for your father [the late senator Robert F. Kennedy] in 1968. I have supported your uncles each time they have sought national office, primarily because of their courage -- and that of your father's -- in facing tough and controversial issues."

In a statement from Boston, young Kennedy apologized for the return of Abourezk's $100 check and added: "In this instance I see a clear difference between Senator Abourezk's personal contribution and some of his political beliefs." He added that if Abourezk were willing to resubmit his contribution, "I'd be quite honored to accept.