In ceremonies reminiscent of the great state funerals familiar to Washington, the Mormon Church this weekend said a last goodbye to its "prophet, seer and revelator," Spencer W. Kimball, the church president who died last Tuesday.

About 40,000 people lined up in a chilly rain here Friday to file past the church leader's coffin, and about 4,000 attended the funeral service this morning in the Mormon Tabernacle just behind the towering granite temple that is the geographic soul of the worldwide Church of Jesus Christ of Latter-day Saints.

Presiding at today's service was 86-year-old Ezra Taft Benson, the former U.S. secretary of agriculture (1953-60) who seems likely to be named the new leader of the world's 5.8 million Mormons.

The Mormon faith teaches that each church president is a prophet chosen by God. The choice may become final Sunday when the church's ranking hierarchy, the Quorum of the Twelve Apostles, is to meet in an upper room of the temple here.

Benson is the current leader of the Quorum. Under modern Mormon procedure, he would thus succeed Kimball in the presidency unless he reported a revelation from God that someone else should be given the position.

Benson was an outspoken conservative Republican during his governmental career and has continued to speak out for conservative positions since returning here to join the church leadership.

Many Mormons believe he played a major role in the church's extensive campaign against the proposed Equal Rights Amendment to the Constitution. He and other Mormon leaders said the amendment would undermine basic family values.

One question being asked by Mormon intellectuals here is whether Benson, as president, might seek to involve the church in other political debates. In a 1980 speech, he suggested that the faithful should not try to separate their religious and political beliefs.

In his remarks at the funeral today, Benson noted in a trembling voice that Kimball, the grandson of one of the first members of the 160-year-old faith, was well-suited for his leadership role because "He knew the Lord. He knew how to speak to Him and how to receive answers."

Benson recalled Kimball's best-known change in church doctrine: his announcement in 1978 that God had told him "in an unmistakable manner" that blacks should no longer be excluded from the Mormon priesthood.

More than 70 percent of Utah's 1.6 million residents are Mormons. In many rural counties, more than 90 percent of the population belongs to the church.

Accordingly, the death and burial of the 90-year-old Kimball was an event of major import here. Although Kimball had never held a governmental position, flags are at half-staff here on all local, state and federal buildings. Live coverage of today's funeral preempted all other broadcasting on Salt Lake City's three television stations.

Adding to the mood of the moment, a few hours before the funeral, the city experienced an unusual meteorological phenomenon: a snowfall accompanied by thunder and lightning. In the darkness before dawn, enormous bolts of lightning glistened off the gilded statue of the angel Moroni atop the temple's tallest spire.

At the ceremony, the Mormon Tabernacle Choir sang Mendelssohn's setting of the scriptural passage "How Lovely Are the Messengers." Several ranking members of the church leadership joined Benson in recalling the late president's life and work.

Many of the speakers emphasized Kimball's strong faith in his ability to receive communications from God. Kimball himself had said he was continuing a "communication line" opened in the 1820s by Joseph Smith, the young New Yorker who founded the Mormon faith.

"The sound of the voice of the Lord is a continuous melody and a thunderous appeal," Kimball wrote in 1977. "For nearly a century and half there has been no interruption."