"Well, we bought it!" proclaimed Robert Bernstein, president and chairman of Random House, triumphant yesterday at the conclusion of the bidding for Edmund Morris' planned biography of Ronald Reagan. According to several sources, Morris will be paid about $3 million for the project.

"A very good contract," remarked Georges Borchardt, Morris' literary agent.

"I don't know of any single nonfiction book that has received a bigger advance," said Rafe Sagalyn, a Washington-based literary agent.

The extraordinary price can be accounted for by the author, the subject and the unusual conditions of the projected work.

Morris, 45, a native of Kenya and now a U.S. citizen, is the Pulitzer Prize-winning author of "The Rise of Theodore Roosevelt," the first of a three-volume history. His selection as Reagan's biographer stems from a 1983 dinner party at the home of Sen. Mark Hatfield (R-Ore.), attended by the president and several presidential biographers. At the dinner, there were complaints about the distance between subject and biographer -- and all wished that time and space could somehow be magically bridged.

This year Reagan chose Morris as his historian, and in so doing agreed to give the writer unusual access to his presidency. For some time, Morris has been permitted to witness White House staff meetings and has conducted lengthy interviews with Reagan. When his unprecedented arrangement was revealed last week, Morris was returning with the president from the Geneva summit.

By then, he had already met with publishers eager for the book. On Nov. 11 he conferred with senior representatives of Random House. "We liked him enormously," said Bernstein. "He's understated, extremely direct. You get a terrific feeling of confidence that he'll deliver what he said he'd deliver."

Random House's principal competitor in the bidding was Harper & Row, publisher of former Office of Management and Budget director David Stockman's memoirs, for which it paid more than $2 million. Edward Burlingame, the publisher of Harper & Row's trade division, was eager for the Morris book.

"This is an opportunity that a writer of Edmund Morris' stature has never been given before," Burlingame said. He described the endgame as a "bruising struggle," which Random House won. "I am very disappointed we're not going to be publishing it," said Burlingame. "We fought very hard."

Random House gained more than the Reagan book. It also purchased the contract for the second book of Morris' Roosevelt biography, "Theodore Rex," paying less than $300,000. A third volume is likely to be the subject of future bidding.

The Reagan book is intended to be one volume -- "perhaps our longest nonfiction book," said Bernstein. The book, as yet untitled, has a completion date of Jan. 1, 1991, two years after Reagan leaves office. "It will be read for years after we're all gone," said Bernstein.

Morris, for his part, is relieved that the bidding ordeal is finished.

"I feel very happy about it," he said from his Washington home. "I just want to get back to writing."