Former Secretary of State Hillary Clinton was apparently behind the 2010 nomination of then-Berkeley law professor Goodwin Liu to serve on the Ninth Circuit Court, a fiasco for the Obama administration that ended with Liu withdrawing his nomination the following year following revelations of his numerous controversial writings.

Clinton was a key early booster of Liu who in official emails released late Tuesday discussed with aides in 2009 how to sell his nomination to reluctant White House officials and Senate lawmakers.

The emails laid out a strategy of describing Liu's record in completely different and even contradictory terms based on who they were trying to convince.

In a March 20, 2009, email, Cheryl Mills, Clinton's chief of staff, told her boss she had attached two sets of talking points to be used for two calls on behalf of Liu's candidacy.

"The first set is for Sen. [Dianne] Feinstein, which stresses Goodwin's moderate judgment — she apparently needs reassurance that Goodwin is not too liberal. The other set is for [White House attorney] Greg Craig, which stresses Goodwin's progressive credentials as he likely will find that more appealing," Mills wrote.

This was almost a year before the White House's nomination of Liu on Feb. 24, 2010, meaning Clinton was one of his earliest and most prominent supporters inside the administration.

Feinstein's office did not respond to a request for comment.

Why was Clinton going to bat for a judicial nomination in the first place, something far outside her role as the administration's top foreign policy official? She was apparently doing a favor for a friend, Ann O'Leary.

O'Leary had worked in the Clinton White House and was later a Clinton Senate aide. She is currently a senior policy adviser to her 2016 presidential bid. She is also Liu's wife.

It was O'Leary actually who wrote the talking points regarding her husband that Clinton used. The emails show that Mills then forwarded them directly to Clinton.

The first reference to Liu appears in a late evening March 19, 2009, email, in which O'Leary thanks Mills for apparently agreeing to help back his nomination. "THANK YOU," she writes, and adding it would be "terrific" if Clinton herself could promote Liu.

"If possible, it would be great if she could also call Feinstein because we are hoping Feinstein will not just bless, but affirmatively support Goodwin's nomination," O'Leary wrote, adding, "I'm pasting the talking points below and attaching them in Word. I'm also attaching Goodwin's bio/resume if you need it."

Mills responded that while the talking points may convince Feinstein, they probably wouldn't work for Craig. A person who had been copied in the exchange, Judy Lichtman, founder of the National Partnership for Women and Families and a close Clinton ally who advised her 2008 presidential bid, suggested a re-write.

"I need a little help about what would go to the heart of [G]reg's interests," Lichtman wrote regarding the White House lawyer.

O'Leary responded, "More of a liberal? I'll do two sets and send it back tonight." She apparently stayed up late into the night doing the re-write, which time stamps show was provided to Mills before dawn the following morning.

A little over a week later on March 29, O'Leary followed up with Mills, saying they had had "several messages from Feinstein's office wanting to set up a meeting with Goodwin."

Mills confirmed that Clinton had spoken with Feinstein and that the senator promised to give Liu her support. "She knows he is imp[ortant] to hrc and that hrc thinks he [is] her kind of scholar and judge."

O'Leary followed up that evening, saying Liu had the meeting with Feinstein and that "it sounds like it went really well," a message Mills forwarded to Clinton.

It is not clear from the emails released Tuesday if Clinton spoke to Craig.

Liu's eventual nomination became a quagmire for the administration after Republican critics objected to him based his writings. Liu had written in favor of "the use of foreign authority in American constitutional law," in a 2006 article adding, "The resistance to this practice is difficult for me to grasp."

He also assailed Supreme Court Justice Samuel Alito's nomination, testifying before the Senate in 2006 that his record "envisions an America" where "police may shoot and kill an unarmed boy to stop him from running away with a stolen purse." Liu later told a Senate panel in 2010 that his attack was "unduly harsh" and in "poor judgment."

Sen. Orrin Hatch, R-Utah, a member of the Judiciary Committee, said at the time that he could not recall a nominee "who more forcefully and directly advocated such an activist judiciary."

The controversies resulted in a filibuster then-Senate Majority Leader Harry Reid, D-Nev., could not break. On May 25, 2011, Liu officially withdrew from consideration. He is now an associate justice for the California Supreme Court.