A Swiss court granted Roman Polanski bail on Wednesday, accepting $4.5 million to allow him to remain under house arrest at his chalet. The director will stay in prison for up to 10 days while the Swiss government decides whether to appeal, according to AP. The Swiss Criminal Court reversed its previous rejection of bail, saying it was confident the large cash guarantee would compel Polanski to remain at his chalet in the Swiss resort of Gstaad under house arrest and monitored by an electronic bracelet. The court said it still viewed him as a high flight risk. The verdict does not affect the Swiss Justice Ministry"s ongoing assessment of whether Polanski should be extradited to the United States for having sex in 1977 with a 13-year-old girl. Polanski fled sentencing in Los Angeles a year later. «The 76-year-old appellant is married and the father of two minors,» the court said as it considered Polanski"s offer of a cash bail secured by his apartment in Paris. «It can be assumed that as a responsible father he will, especially in view of his advanced age, attach greater importance to the financial security of his family than a younger person.» The court said Polanski would be subjected to «constant electronic surveillance» at his chalet and an alarm would be activated if he leaves the premises or takes off the bracelet. But Polanski wasn"t immediately released by the Swiss Justice Ministry, which ordered him arrested Sept. 26 as he arrived in Zurich to receive a lifetime achievement award at a film festival. «We will decide quickly on whether to order his release or file an appeal with the Federal Tribunal,» ministry spokesman Folco Galli said. Authorities had 10 days to refer the matter to the tribunal, Switzerland"s highest court, but Galli said they would make their decision before that. The Federal Tribunal said it had yet to receive an appeal. Polanski"s lawyers Lorenz Erni in Zurich and Herve Temime in Paris declined to comment. The Los Angeles County district attorney"s office also had no reaction, spokeswoman Shiara Davila-Morales said. The decision came as a surprise after a series of setbacks for the director of «Rosemary"s Baby,» «Chinatown,» and «The Pianist.» Swiss legal experts had said earlier that Polanski"s chances of bail were slim, and even U.S. authorities expressed confidence that a Swiss court wouldn"t grant his release. The court last month rejected Polanski"s first bail offer of his Gstaad chalet as collateral, which the director claimed made up more than half of his personal wealth and would definitely guard against his flight because he has two children he must support through school. This time, the court looked favorably on Polanski"s offer of cash and the threat of sacrificing his family"s home if he fled justice. «Cash is king,» said Peter Cosandey, a former Zurich prosecutor. Still, he said he could «hardly remember a case where bail is granted to someone who isn"t even a full-time Swiss resident.» A decision on extraditing Polanski to Los Angeles is still pending, and would also be subject to appeals. Polanski was accused of raping the 13-year-old girl after plying her with champagne and a Quaalude pill during a modeling shoot in 1977. He was initially indicted on six felony counts, including rape by use of drugs, child molesting and sodomy. Polanski pleaded guilty to the lesser charge of unlawful sexual intercourse. In exchange, the judge agreed to drop the remaining charges and sentence him to prison for a 90-day psychiatric evaluation. The evaluator release Polanski after 42 days, but the judge said he was going to send him back to serve out the 90 days. Polanski then fled the country on Feb. 1, 1978, the day he was to be sentenced and has lived in France since. Polanski claims the judge and prosecutors acted improperly. A California appeals court will listen to oral arguments from his attorneys next month. They will be urging the court to order a lower court to decide whether to dismiss charges against the fugitive director, whether he is present or not.