The General Accounting Office said yesterday that Donald J. Devine "illegally circumvented" federal law by attempting to retain power when his term expired as director of the Office of Personnel Management. Devine later asked OPM's acting director if she could lie about her knowledge of his action, the acting director told a Senate committee yesterday.

Devine denied wrongdoing in a statement prepared for his renomination hearing yesterday by the Senate Government Affairs Committee, saying his "delegation of authority" to himself was "strictly a housekeeping measure" to prevent legal challenges to OPM actions.

But Devine did not get a chance to rebut yesterday's testimony by OPM acting director Loretta Cornelius, who said that Devine, fearing "how damaging" his action would look to the Senate, asked her April 29 if she could say that she had been aware of his action, even though she had told him then that she was never informed.

Devine will get an opportunity to respond to Cornelius when hearings on his nomination resume this morning.

On March 25, the day his four-year term ended, Devine signed an order giving himself full power to continue running OPM although he was legally required to step down, because his term had expired. He took a temporary position as Cornelius' executive assistant while awaiting Senate reconfirmation to a second four-year term as head of the nation's civil service.

Cornelius testified that when she learned of his action five weeks later, she decided to fire him. She said Devine told her he had "forgotten" to inform her and later asked her not to disclose his failure to tell her.

"He asked me if I could say that I knew about it," Cornelius said.

Sen. Ted Stevens (R-Alaska) told Cornelius, "I am a former prosecutor . . . and this makes a great deal of difference to some of us. Did Don Devine ask you to say you knew" about the document delegating authority to himself?

"He asked me if I could say that I knew about it, that I was aware it existed," Cornelius said.

"He was asking you to tell an untruth?" asked Sen. Thomas F. Eagleton (D-Mo.).

"He said, 'Couldn't you say you knew about it?' " Cornelius responded.

Cornelius said she refused Devine's request. "I told him, 'I pray to God that nobody asks me about Devine's action ,' " because she would have to tell the truth, she said. Both Eagleton and Stevens praised Cornelius' actions and testimony.

Devine, who sat with his wife and three children behind Cornelius, taking notes, would not discuss her testimony. "I have a very clear and forthright explanation for everything, and I will make my case to the senators," he said.

Devine's March 25 action violated the law limiting his term to four years and he illegally "exceeded his authority" by delegating power to himself, according to an opinion submitted by the General Accounting Office.

That opinion conflicts with OPM general counsel Joseph A. Morris, who testified yesterday that he recommended the action to Devine because he was concerned that actions Devine took in his final days as director might later be challenged. Morris also said he believed that Devine's delegation did not undermine Cornelius' authority.

Yesterday's testimony appeared to further jeopardize Devine's chances of winning Senate approval, according to Democratic and Republican staff members. "The senators are not happy that they didn't know about this," a Republican staffer said. The GOP controls the committee, 7 to 6, but Democrats are optimistic they can block Devine's nomination, despite heavy lobbying by conservative Republicans supporting him.

Cornelius said that when she told Devine she planned to fire him, Devine said, "We need to talk about this. You can't do this."

"I told him I had thought about it all night, that I had the authority to do it, and that I had to do it," said Cornelius, a former corporate executive and Republican activist who has worked at OPM since 1981.

Devine then arranged for the White House to intervene in an effort to get Cornelius to drop her plan to dismiss him, she said.

She said Devine set up a conference call between the two top OPM officials and White House personnel officer Robert H. Tuttle. Tuttle "asked me if we could work out some arrangement" to keep Devine, Cornelius said, "I told Mr. Tuttle I had made a decision." Tuttle could not be reached for comment.

She did not fire Devine, she said, because he agreed May 1 to resign.

Committee Democrats seized on yesterday's testimony as evidence that Devine is unfit for the job. Sen. Albert Gore Jr. (D-Tenn.) said the Reagan administration should "send us another candidate."