Brian Miller was a litigator at New York-based Chadbourne & Parke in 2001 when client AES Corp. invited him to interview for an in-house job in the electricity generation and distribution giant’s legal department.

“I thought, ‘I’m sure in-house is boring, and why would I want to do it?’ ” he said recently.

After consulting with his wife, Miller decided to take the job and move his family from the New York area to Northern Virginia.

Then came catastrophe. Within months, the implosion of Enron dried up financing for AES’s power projects, and investors were dumping electricity stocks following the California electricity crisis. The company was near collapse.

“Our stock went from $36 to $1 within the year,” said Miller, now 47.

Meanwhile, the world economy was struggling with the twin shocks of the technology bust and the Sept. 11 attacks. If that wasn’t enough, the company’s accounting came under scrutiny from the U.S. Securities and Exchange Commission and the New York attorney general’s office, leading to a series of financial restatements and shareholder class actions.

“Career-wise, I was in a very bad place at the right time,” Miller now recognizes. As top executives came and went, he climbed the corporate ladder. In 2005, he was named executive vice president and general counsel and now sits on the boards of AES subsidiaries from Dayton to Istanbul.

AES has since stabilized — its last restatement was in 2007. Miller has added an ethics and compliance office and molded the legal team to his liking. In part, that has meant reducing reliance on outside counsel to better manage costs, he told The Washington Post earlier this year.

“Lawyers need to understand the business and be part of the business team. They’re not here to specialize,” Miller said in an interview.

“I have someone in charge of litigation, but the reason he’s good is he understands how our finance agreements work, our power-purchase agreements work, and it allows him to gain the confidence of the business side. He can show up at a conference in Chile and talk business with those guys.”