Sex-attack suspect Dominique Strauss-Kahn can ditch his filthy jail cell today for an Upper East apartment as part of a hefty bail package that includes GPS monitoring and armed guards around the clock, a judge ruled yesterday.

The disgraced former head of the International Monetary Fund must cough up $1 million in cash and post a $5 million insurance bond before he can sashay from his solitary-confinement jail home.

Manhattan Supreme Court Justice Michael Obus agreed to bail terms only after branding Strauss-Kahn a flight risk and issuing a stern warning to the jet-setting international moneyman, who allegedly tried to rape a maid last Saturday at the Sofitel New York in Midtown.

* Strauss-Kahn was indicted on a host of sex charges, including two counts of criminal sexual act, one count of attempted rape, sexual abuse and unlawful imprisonment, District Attorney Cyrus Vance said. Strauss-Kahn faces up to 25 years in prison.

* A law-enforcement source said that when first questioned by NYPD detectives, Strauss-Kahn blurted out that he had had a vasectomy, thinking they would be fooled into believing he left no DNA evidence in the hotel room.

* The IMF’s executive board met yesterday and was scheduled to meet again today as French Finance Minister Christine Lagarde, 55, emerged as the leading candidate to take over the global lending organization. The agency also announced that it had passed new anti-sex-harassment regulations on May 6 in response to a 2008 complaint from one of Strauss-Kahn’s subordinates.

* Strauss-Kahn’s wife, multimillionaire French journalist Anne Sinclair, has rented a Midtown apartment where he will be confined until the outcome of his criminal case. She also backed his bond with her $4 million mansion in Washington, DC.

The judge’s decision came after fierce wrangling between the defense team and prosecutors over the dangers of letting him post bail.

As part of the strict conditions, Strauss-Kahn must pay the $200,000-a-month fee for gun-toting guards who are permitted to use force if he tries to escape.

Force will not be necessary, insisted one of Strauss-Kahn’s lawyers, Benjamin Brafman.

“They are certainly permitted to use reasonable force necessary to restrain or to prevent his escape,” the lawyer said. “That, however, will not be a problem with this client, who is intent on coming to court to clear his name.”

He must also wear an ankle monitor — and can leave his apartment only for visits to court, doctors, house of worship and his lawyers. The fallen financial big shot is restricted to just four nonfamily visitors at one time.

Strauss-Kahn, 62, who has been jailed since he was plucked off an Air France plane at Kennedy Airport just moments before it could take off, flashed a cavalier smile at Sinclair and his daughter, Camille Strauss-Khan, 26, when he entered and left the courtroom.

William Taylor, speaking for Strauss-Kahn’s team of five lawyers, called the one-time French presidential front-runner a man of honor and guaranteed he would show up in court.

“In our view, no bail is required to secure the return to court of Mr. Strauss-Kahn. He has just one interest at this time, and that is to clear his name,” Taylor said as Strauss-Kahn, in a crisp, dark suitcoat and open collar, nodded in agreement.

Taylor bragged about the defendant’s credentials as a big shot on the world financial stage, saying he was involved in rescue efforts for several ailing countries and had been on his way to meet German Chancellor Angela Merkel when he was arrested.

He also blasted the District Attorney’s Office for opposing his client’s release — but prosecutors maintain that Strauss-Kahn is too great a flight risk to be set free.

“The proposition that $1 million is too high a price to pay for his freedom is not convincing,” Assistant District Attorney Artie McConnell said.

“This defendant is a citizen of France, a country that by law does not extradite its own nationals. He has the stature and the resources not to be a fugitive on the run but to really live in ease and comfort in parts of the world that are beyond this court and its jurisdiction.”

McConnell pointed out that Strauss-Kahn bolted from the hotel immediately after the alleged crime and quickly boarded a flight to Paris — and the prosecutor insisted Strauss-Kahn would try to run again.

McConnell said the DA’s Office is building a strong case against Strauss-Kahn based on the maid’s testimony and forensic evidence from the room, which sources say includes semen DNA samples.

Before approving the bail package, the judge acknowledged that “if the defendant is able to leave the country, it will be impossible to get him back here.”

After court, Strauss-Kahn was carted back to Rikers Island. His wife and daughter were whisked away in a Lincoln Town Car.

The maid has told cops her ordeal began when she went to his $1,500-a-night room to clean, thinking it was empty.

He allegedly jumped from a bathroom naked and forced her to perform oral sex. Investigators are running DNA tests on pieces of carpet taken from the room.

Speaking after the bail hearing yesterday, Manhattan DA Cyrus Vance addressed the rampant French media criticism that Strauss-Kahn was being singled out for unfairly harsh treatment.

Strauss-Kahn’s indictment was voted Wednesday by “An independent body comprised of 23 impartial jurors,” Vance told reporters. “The work of the Manhattan District Attorney’s Office will be guided in this case, as it is every case, by one principle: to do whatever is right, without fear or favor, wherever that might lead,” he said.