A New York grand jury has indicted former International Monetary Fund managing director Dominique Strauss-Kahn on charges arising from the alleged sexual assault of a hotel maid last week, but a judge agreed Thursday that he could await trial in a New York apartment after posting $1 million in bail and agreeing to electronic monitoring.

The ruling ends Strauss-Kahn’s incarceration at the Rikers Island jail but leaves him facing trial on seven criminal charges, including commission of a criminal sexual act and attempted rape. He faces a prison term in excess of 25 years if convicted.

“These are extremely serious charges, based on the grand jury’s determination that the evidence supports the commission of nonconsensual, forced sexual acts,” Manhattan District Attorney Cyrus R. Vance Jr. said in a brief statement.

A formal arraignment will be held June 6. Strauss-Kahn’s attorneys have said that he plans to plead not guilty.

Strauss-Kahn resigned from the IMF Wednesday night, saying in a letter to the fund’s board that he wanted “to protect this institution which I have served with honor and devotion” and concentrate on his legal defense.

His departure intensified a campaign for his replacement as European nations angled to retain the job for one of their own and developing nations argued that there should be a broader competition for the post.

French Finance Minister Christine Lagarde was given an early edge by some analysts as Europe’s likely consensus choice. She has been influential in designing financial bailout packages for Greece, Ireland and Portugal and pushing for a broader effort to rebuild Europe’s economy. As a woman, she would represent a step toward diversifying the IMF’s top management while allowing a European to complete Strauss-Kahn’s term, which expires next year.

U.S. officials, who hold an influential voice as the IMF’s top contributor, withheld any immediate endorsement, however, saying that they wanted a selection process that was “open” and swift.

The board began its discussions Thursday, agency officials said.

Strauss-Kahn, 62, a charismatic figure whose command of the IMF laid the groundwork for a possible run next year for the French presidency, is expected to spend one more night on Rikers Island before being released under strict conditions to ensure that he remains in New York until his trial.

He will be confined to a Manhattan apartment, under 24-hour electronic monitoring, and required to hire an armed guard to watch over him — arrangements that prosecutors said could cost Strauss-Kahn as much as $200,000 a month.

In addition to $1 million in cash, he is being required to post a $5 million insurance bond secured by his wife’s Georgetown home or other assets that would be surrendered if he does not appear for trial.

Vance’s office had opposed bail, arguing that Strauss-Kahn was a man with the means, influence and incentive to leave the country for his native France, where weak extradition laws would make it difficult for New York to compel his return.

New York State Supreme Court Judge Michael Obus said he was worried about the flight risk posed by Strauss-Kahn and, addressing the defendant directly at an afternoon hearing, warned him that bail could be revoked “if there is the slightest problem with your compliance.”

The case has rattled international financial circles, within which Strauss-Kahn had become a prominent figure as the man who rescued the IMF from near irrelevance and turned it into a central player in the response to the global economic crisis.

John Lipsky, the No. 2 official at the IMF, who was named acting managing director, said he expected the agency’s 24-member executive board to “expeditiously” pick a permanent leader.

Lipsky said that although Strauss-Kahn had played a personal role in several high-level IMF issues, including negotiations over Europe’s ongoing economic troubles, “the interregnum is going to proceed without any problem.”

In comments after a speech at the Peterson Institute for International Economics, Lipsky bristled at the idea that Strauss-Kahn’s absence would harm the IMF’s work. Although the arrest had taken an emotional toll, he said, “to think the institution needs one man, however talented he might be, that the IMF depends on one person, is an illusion.”

Lipsky called Lagarde a “very, very talented and capable leader. . . . She is one of many names mentioned” as a potential agency chief.

The search for a new IMF managing director is quickly shaping up as a battle between the developed nations that pay the agency’s bills and the developing nations that are reshaping the global economy. Since the IMF’s founding after World War II, the managing director’s job has by tradition gone to a European.

Lael Brainard, Treasury undersecretary for international affairs, said at a luncheon at the IMF on Thursday that the United States had not settled on a candidate.

“We have not taken a position on any particular candidate,” she said, but “it’s important that we move quickly to an open process to promptly select the next managing director.”

European officials were quick to close ranks.

“I think that in the current situation, in which we have significant problems with the euro and the IMF is strongly involved in this, there is something to be said for it being possible to put up a European candidate and to canvass for that in the international community,” German Chancellor Angela Merkel said in Berlin.

There is a long list of possible contenders for the job. Officials from developing economies and several outside analysts have begun to argue that there is no reason someone such as Lagarde or former British prime minister Gordon Brown should have an automatic advantage over Singapore Finance Minister Tharman Shanmugaratnam, former Turkish finance minister Kemal Dervis or former South African finance minister Trevor Manuel.

Dennis reported from New York.