They tried to close the main reading room of the Library of Congress early yesterday evening -- for the first time on a weekday since 1897, according to library officials -- but the people wouldn't leave.

"It is 5:30; the reading room is officially closed!" intoned an employe in his best All-Is-Well voice.

But all was not well, what with a third of the open public hours at the library being slashed -- because of the Gramm-Rudman-Hollings balanced budget act, officials say. So about 100 scholars, lawyers, library employes and someone who shouted that she was a "woman from Minnesota" stayed on, vowing they would not be moved.

One by one -- and one was a 79-year-old man wearing a jester's cap, blue for Old Eli Yale -- they mounted the burnished wood platform in the center of the vast ornate domed chamber and made their fervent declarations.

"We are here this evening to protest the upside-down priorities of the Reagan administration!" shouted Russell Mokhiber, 31, a lawyer with the Corporate Accountability Research Group, which he described as a Ralph Nader organization.

Mokhiber, who said he has worked nights at the library on "corporate crime," went on in his shouted speech: "We condemn President Reagan's policy of spending billions of taxpayer dollars on wars, 'Star Wars' and weapons of destruction, while at the same time cutting essential human services to the people."

The man in the jester's cap, Carlos Van Leer, Yale '28, said he is with St. Stephen and the Incarnation Church. He held up a sign that said, "FOOLS SCORN BOOKS." When the lights were turned down at 5:30, Van Leer commented, "The great light of freedom is being dimmed here."

Another man stood and shouted, "I'm an historian!" He then referred to "a time when the people were squashed by the big-money interests . . . The people rose up and . . . they threw out the rascally politicians."

Employes stood nearby and listened. Officials had been informed of the demonstration in advance ("The protest starts at 5 in the main reading room," library spokesman Nancy Bush had said earlier, incorrectly, as it happened).

As events unfolded, officials appeared to cooperate with the demonstrators; they opened the doors of the main reading room to the press after 5:30, apparently to assist television crews.

Mokhiber declared that old library hours must be restored and that "if this demand is not met, we will escalate our activities to secure the library for the people." He vowed that demonstrators would continue to sit-in evenings.

Donald C. Curran, the associate librarian of Congress, said he hoped that would not happen.

"We're trying to deal with this one day at a time," he said. ". . . We expect that they'll leave peacefully . . . and they've made their statement and, as far as we're concerned, this is the end of it."

Curran said library officials realized they would be confronting "civil disobedience.

"Our concern is for an orderly process," he said. ". . . We don't want to be destructive. We don't want to make the library a hostile place."

Curran described the official library response as "an ad hoc practice of toleration." If the protests continue, he said, "we'll discuss it and think about it."

To meet this year's budget cuts, which total $18.3 million, library officials have decided to cut by a third the hours that its general reading rooms are open -- and have begun reducing the 5,200-member staff by 300. Now the reading rooms, which used to be open until 9:30 p.m. weekdays and on Sundays, are closed Sundays and evenings, except for Wednesday.

Officials have also sharply curtailed expenses for acquisitions, preservation, services for the blind and handicapped, and other activities.

By 7:30, most of the reporters were gone and the speechmaking was winding down. People worked, read or talked quietly among themselves, and the public discussion among the crowd, which had dwindled to 20 or so, focused as much on how the protest should be pursued as on what and why they were protesting.

Said one speaker, after a lengthy lull, "No revolution is dull on TV, but it sure can be dull in person."

Suggested another, "I think we should limit our speeches to between 5:30 and 6:30 and the rest of the time people can do their work. Everybody knows why we are here and there's no use going over it again and again. While the media is here, it's important to speak, but the rest of the time, people have work to do. And if we could maybe dress nice, that might project a good image to Middle America."

Elwin Powell, a sociology professor at the State University of New York at Buffalo, who took an "emergency leave" from his job to participate in the protest, responded, "I want to register a complaint against that comment . . . This has been a marvelous experience, to find other people who have this love of libraries, and I think we should get to know one another."

By 7:45 the speeches had ceased and people talked informally. It was nearly as quiet as any library, although several extra Library of Congress special police remained poised on the gallery above, just in case.

At 9:27 Mokhiber stepped to the podium and announced that there would be another meeting today, same time, same place, and urged those present to bring others along.

The 15 diehards left promptly at 9:30. Steve Herman of the Chief Collections Management Division turned off the lights but refused to comment on the event, as did the special police, who locked up the reading room for the night.