Treasury secretary nominee Jack Lew has spent most of his career in government, but during the financial crisis, he was embedded inside one of the country’s biggest banks as it nearly imploded.

From 2006 to 2008, he worked at Citigroup in two major roles, a notable line in his résumégiven that as Treasury secretary, he would be charged with implementing new rules regulating Wall Street.

But Lew did not have just any position at the bank.

In early 2008, he became a top executive in the Citigroup unit that housed many of the bank’s riskiest operations, including its hedge funds and private equity investments. Massive losses in that unit helped drive Citigroup into the arms of the federal government, which bailed out the bank with $45 billion in taxpayer money that year.

The group had been under pressure to compete with similar units at other big Wall Street firms and, some analysts say, took on too many risks as it played catch-up.

White House Chief of Staff Jacob Lew joked about his poor penmanship after President Obama nominated him for Treasury secretary . (The Washington Post)

“The mismanagement of risk was comprehensive at that organization,” said Simon Johnson, an economist at the Massachusetts Institute of Technology.

Details about Lew’s exact responsibilities at Citigroup, where he worked from 2006 to 2008, are scant. He declined to comment for this article.

Lew’s first job at the bank was chief operating officer of Citigroup’s wealth management unit, which flourished under his watch.

By the fall of 2007, the wealth management group handled $1.8 billion in client assets, up 34 percent from the year before, according to financial statements. More than 15,000 financial advisers and bankers worked under Lew.

In January 2008, he switched to Citigroup’s alternative investments unit. A press release announcing his new position as chief operating officer of the group said he would “oversee coordination between the operations, technology, human resources, legal, financial and regional departments.”

The memo stated that Lew also would be a member of Citigroup’s management committee, a group of senior executives who met regularly to discuss different parts of the bank’s business.

During his 2010 confirmation hearings for chairing the Office of Management and Budget, Lew said his Wall Street experience was “as a manager, not as an investment adviser.”

“Senator, I don’t consider myself an expert in some of these aspects of the financial industry,” Lew said in response to a question from Sen. Bernard Sanders (I-Vt.) about causes of the financial crisis.

Sanders said in a statement Wednesday that although he applauds Lew’s public service, he worries about the number of economic advisers in the White House who have spent time on Wall Street. Michael Froman, deputy national security adviser for international economic affairs, also came from Citigroup’s hedge fund and private equity shop, known as the alternative investments unit.

“In my view, we need a treasury secretary who is prepared to stand up to corporate America and their powerful lobbyists and fight for policies that protect the working families in our country,” Sanders said. “I do not believe Mr. Lew is that person.”

The beginning of 2008 was a brutal time to be working at the bank and certainly at Citigroup’s alternative investments unit, which managed more than $54 billion.

The group was hemorrhaging money just as Lew joined. In the first three months alone, it lost $509 million, according to SEC filings. By contrast, just a year earlier during that quarter, the unit made $222 million.

“He stepped into the hedge-fund buzz saw,” said Mark Williams, a lecturer in finance at Boston University and a former bank examiner for the Federal Reserve. “His timing wasn’t the best.”

Things continued to deteriorate the rest of the year. More than 50,000 employees, or one-seventh of Citigroup’s global workforce, were laid off in November. That year, the stock price dropped about 75 percent. Lew, meanwhile, was paid at least $1.1 million in 2008, according to financial disclosure statements.

By the end of December 2008, Lew had lined up a new job: away from Wall Street and back in Washington as a deputy secretary of state under Secretary Hillary Rodham Clinton.

Meanwhile, Citigroup’s alternative investments unit had become such a stain on the bank’s record that it was relaunched three years ago with a new name. It’s now known as Citi Capital Advisors.