Private equity fund The Carlyle Group will pay a $20 million penalty to settle its role in a probe of investment firms that hired politically connected people to help them get chosen to manage New York state's pension fund, the state's attorney general said on Thursday.

Carlyle also agreed to a new code of conduct that bars it from using middlemen to win business from public pensions and blocks campaign contributions to pension officers for two years, New York Attorney General Andrew Cuomo told reporters on a conference call.

Cuomo's probe, which has led to two guilty pleas and been joined by the U.S. Securities and Exchange Commission and 36 states, centered on the role of former New York state comptroller's top fund-raiser Henry Morris, who was indicted along with the pension fund's chief investment officer.

It's the intersection of corporate and government corruption, the Democratic attorney general said.

Before Carlyle, which as one of the world's biggest funds manages $85 billion of assets, hired Morris it had only limited success in getting chosen to help invest New York's $122 public pension fund, Cuomo said.

But after Carlyle retained Morris on the advice of a partner, New York's pension fund committed to invest $730 million with Carlyle.

The private equity fund then paid nearly $13 million to the Connecticut-based broker dealer Searle that worked with Morris, and Searle paid the lion's share of the fees to a shell company that Morris controlled, Cuomo said.

Carlyle, in a statement, said it was victimized by Hank Morris's alleged web of deceit, adding it intends to sue Searle and Morris for more than $15 million to recover the fees it paid and other damages.

Carlyle's new code applies to all its business throughout the nation.

The code, which Cuomo wants other investment firms to accept, also blocks the fund from managing pensions for two years if the firm, its principals, employees and family members make political contributions to elected or appointed officials who have sway over investment decisions, the attorney general added in a statement.

We are trying to create a race to the top, Cuomo said.

(Additional reporting by Megan Davis, Editing by Chizu Nomiyama)