Elena Kagan was far along in the new Obama administration’s vetting process for an important U.S. Justice Department job when she got a call from the White House.

That job she was in line to get? Well, the White House wanted her to do something else. Kagan was asked to be the U.S. solicitor general instead and was nominated for the position on Jan. 5, 2009. The rest is history.

Kagan recounted this memory last week at an Aspen Institute chat with Margaret Marshall, former chief justice of the Supreme Judicial Court of Massachusetts. Kagan wouldn’t identify the position, but several sources with knowledge of the vetting said she was up for deputy attorney general at the Justice Department, the second-in-command there.

David Ogden (February 5, 2009)

That position ultimately went to David Ogden, who kept the post for 11 months before returning to the partnership at Wilmer Cutler Pickering Hale and Dorr. Kagan, through a U.S. Supreme Court spokesperson, declined to comment on her remarks at the event in Colorado.

Matthew Miller, a former spokesman for then-U.S. Attorney General Eric Holder Jr., said in an email, “Getting SG instead was the best career diversion ever, I’d say.”

Rahm Emanuel reportedly favored Kagan—who served in the Bill Clinton White House counsel’s office—over Ogden for the deputy slot. Ogden, on the Obama transition team, was said to have the backing of the incoming president’s advisers. “Kagan brings legal policy credentials; Ogden has more experience in the Justice Department trenches,” according to a November 2008 report in Newsweek.

In the end, Kagan was “a woman more than presentable as a Supreme Court justice, running the Justice Department or representing the government,” said a former administration official familiar with the discussions.

At the Aspen talk, Kagan said about the first Justice Department position she was vetted for: “It was a job where I thought, well, this is a job that kind of makes sense—I have some of the experiences and skills to do quite well in this job.” Kagan added, “I was pretty far along the way through the vetting process—where everybody reads every word you’ve ever said and talks to everybody you’ve ever known since kindergarten. I was pretty far along that process and I suddenly got a call—and it said, ‘Well, we’ve decided that you’re not going to get that job.’”

Kagan, then the dean of Harvard Law School, said she remembered thinking: “What?”

She reminded the White House that she had never made an argument in the U.S. Supreme Court, or any federal appeals court, for that matter.

“I’m not the person you want or need,” she recalled telling the White House on that phone call. “I’m not the right person for that job, to fill that role. They said, ‘No we’ve sort of thought about this a lot and we’re really confident you can do this.’”

Kagan said she’d call back in a day or two—she needed time to think about the White House pitch. “I have a healthy self regard, believe me. But I just didn’t know,” she said. But, Kagan added, “that self-regard took over again—and I called them back and I said yes.”

Kagan was confirmed as solicitor general in March 2009, about two months after her nomination. She was the first female to hold the position. In May 2009, Kagan had already reportedly made an Obama administration shortlist of potential Supreme Court nominees.

Less than a year later, Obama nominated her for a seat on the Supreme Court.

“I couldn’t have done it except that the solicitor general’s office is such a remarkable place. It’s staffed with these fantastic appellate lawyers, who stay the same from administration to administration to administration,” Kagan said. “They are remarkable lawyers. They were incredibly generous people. They basically taught me everything I know—whatever that is.”

Donald Verrilli Jr., who is now a Munger, Tolles & Olson partner, was Obama’s subsequent pick for solicitor general after Kagan. In the DOJ’s front office, James Cole, and then Sally Yates, succeeded Ogden as deputy attorney general. Cole later joined Sidley Austin in Washington, and Yates was fired in January after Jeff Sessions took over the Trump administration’s Justice Department.

Mike Scarcella in Washington contributed to this report.