SAN FRANCISCO, SEPT. 17 -- Pope John Paul II, traveling to the edge of this city's largest gay neighborhood, offered forgiveness and the love of God as solace to those dying of AIDS.

To the more than 50 AIDS victims -- including two priests -- gathered in San Francisco's Mission Delores Basilica, his message was movingly received and accepted, even though hundreds of homosexuals had gathered outside to protest his visit.

"It was very beautiful," said Daniel LeFleur, a 31-year-old from San Francisco's East Bay area who is suffering from AIDS. "His was a message of love; what he said about AIDS I feel proves he is sympathetic to our plight."

However, gay leaders, who did not attend the meeting, were surprised the pope did not show greater understanding of homosexuals and the ravages of acquired immune deficiency syndrome, his blessing for the sick made only passing reference to the disease and no reference to homosexuality, which the church condemns.

"God loves you all, without distinction, without limit," the pope told as many as 1,000 ill and ailing gathered at the 211-year-old Mission Delores basilica near the predominantly gay Castro district. The pope arrived at the mission after a motorcade gave him a look at the Golden Gate Bridge.

The pope entered the ancient basilica and greeted AIDS victims and their family members gathered along the right-hand side of the aisle.

Four-year-old Brendan O'Rourke was thrust into the pope's arms by his father, John. The boy grabbed the pope's ears as the pontiff embraced him.

"He loves to hold the ears of those he likes," said his father with tears in his eyes, explaining that his pale, sickly, blond son contracted AIDS from a blood transfusion when he was born.

The pontiff told the audience "God, loves you who are elderly, who feel the burden of the years. He loves those of you who are sick, those who are suffering from AIDS and from AIDS-related complex {a forerunner of the disease}. He loves the relatives and friends of the sick and those who care for them. He loves us all with an unconditional and everlasting love."

It was the pope's third mention of AIDS on this 10-day U.S. tour, his second pastoral trip to America in his eight-year papacy. On the plane en route from Rome to Miami last Thursday, he told reporters that the church was doing "all that was possible" to deal with and "prevent" the "moral background" of the disease, an apparent reference to homosexuality.

In a talk Monday to health-care workers in Phoenix, the pope urged them to "show the love and compassion of Christ and His Church" to AIDS victims.

Because the Catholic Church had made a point of assembling AIDS victims to meet the pope, members of San Francisco's large, vocal gay community had said they hoped he might make a significant statement on church policy on AIDS and, perhaps, homosexuals.

The federal Centers for Disease Control has recorded 41,825 AIDS cases in the United States and 24,070 AIDS deaths. The disease is transmitted primarily in blood and some other body fluids, and most of its victims are homosexual men or intravenous drug users.

"If offering God's love is all he has to say about it, it is shocking," said Tom Carroll, regional director of Dignity, a nationwide organization of gay Catholics. "If that is all he has to say on AIDS, he has done the church and gays a real disservice.

" . . . It seems to me that the church is only dealing well with the dying," Carrol said. "But they continue to be unable to deal well with the living."

The gay community was outraged last October when the Vatican issued a letter to the church's bishops -- "on the pastoral care of homosexuals" -- that labeled homosexuality an "objective disorder." The 115-page letter said that even an "inclination" to homosexuality bordered on "an intrinsic moral evil."

The pope reiterated that position in a speech Wednesday to 300 U.S. bishops in Los Angeles and said homosexuals should practice "chastity" if they want to be good Catholics. Archibishop John Foley, the Vatican's director of social communications, angered homosexuals with a recent statement implying that AIDS was God's "sanction" against sexual immorality.

Foley's statement helped spark various protests organized to coincide with the pope's visit here on the penultimate stop of his trip. He arrives Friday night in Detroit and leaves Saturday for Canada.

After his visit with AIDS victims, the pope was driven to San Francisco's modern St. Mary's Cathedral where he ended his day at a meeting wth men and women representing religious orders. He praised the nuns, priests and brothers for their efforts in "defending human rights and . . . building a more just and equitable society."

The comment marked a quiet victory for nuns, whose work before the Second Vatican Council in 1965 was restricted largely to school and hospital work. Under the the council's mandate to expand their ministries to meet modern needs, nuns were widely criticized as they moved out of convents and into the world.

Both the Rev. Stephen Tutas and Sister Helen Garvey, who reported to the pope on the state of U.S. religious orders, cited acute problems created by declining numbers and scarcity of recruits.

The pontiff acknowledged their concern but expressed confidence that "the radical newness of the Gospel message is always able to inspire successive generations" to follow in their footsteps. But he did not respond to the question, raised today by Garvey and Tutas and Wednesday by U.S. bishops, of expanding the roles of women in the church.

"We desire for ourselves, and for all believing women, complete incorporation in the church," Garvey said. "In its critical decision-making responsibility, the church needs the fullness of women's gifts and the strength of women's commitments."

In his speech Wednesday to the bishops, the pope reaffirmed the church's stand against women in the priesthood. But he acknowledged today that pressure for reform has created some strain within the church.

"Whatever the tension and polarization occasioned by change, whatever the mistakes made in the past," he said, "I am sure that all of you are convinced that the time has come to reach out once again to one another in a spririt of love and reconciliation, both within and beyond your congregations."

Between the grandiosity of Los Angeles and the cacophony of San Francisco, the pope spent most of today in the Big Sur country of the Monterey Peninsula. There, he celebrated mass at Laguna Seca Raceway, was greeted by Carmel Mayor Clint Eastwood ("Thou Maketh My Day," T-shirts read), and visited the grave of California missionary Junipero Serra.

At the Laguna Seca Amphitheater, in what is called the Salinas Valley "salad bowl," the pope again spoke about the conflict between wealth and morality -- what he sees as the temptation of technologically advanced communities to create their own secular world. "To feign the death of God," he said, "is to promote the death of man."

Here, too, in the land of the grapes of wrath, where author John Steinback defined the despair of one generation and union leader Cesar Chavez organized another, the pope resume his role as defender of the poor and the working class.

This time, he took the part of family farmers and farmworkers who "express their anxieties over the costs and risks of farming, the difficult working conditions, the need for a just wage and decent housing, and the question of a fair price for products."

Addressing an audience of largely Chicano farmworkers, the pontiff said that the central issue in America's farm crisis must be "the dignity, rights and well-being of people" and that the grower is no more important than the field hand. He expressed particular concern for the thousands of farmworkers, most of them Hispanics, who pick the crops of this state.

Returning to the immigrant theme he set in San Antonio, the pontiff urged Californians to embrace the hundreds of thousands of Mexican farmworkers who will qualify for legal American status under provisions of the 1986 immigration reform law.

"Many of these people have worked here with the same dream that your ancestors had when they first came," he said. "I ask you to welcome these new citizens into your society and to respect the human dignity of every man, woman and child."

At Father Serra's grave, the pope again addressed the Catholic Church's role in colonizing and converting the region's native Indians. He called the 300-year-old missions "the result of a conscious moral decision made by people of faith in a situation that presented many human possibilities, both good and bad."

Indians have opposed efforts to canonize Serra, saying that he was an accomplice of the conquistadors who stamped out Indian lives and culture. As he did at a conference of American Indians in Phoenix, the pope praised Serra here, saying he became the Indians' "defender and champion."