The Flyers are buying out Ilya Bryzgalov, who had an up-and-down two seasons with the team and had a sometimes-contentious relationship with coach Peter Laviolette.

The Flyers will have to pay him $23 million (two-thirds of the $34 million left) over 14 years, or $1.6 million per year. They cannot officially buy him out until 11 p.m. Wednesday.

"It's obviously a costly mistake," said general manager Paul Holmgren, who is attempting to sign star center Claude Giroux to a long-term deal. He called it a "very difficult" decision, but that it was done for cap flexibility.

With the buyout, the Flyers will have nearly $4.2 million cap space. They will have about about $9.1 million when Chris Pronger goes on the long-term injured list at the start of the season.

The decision was made "strictly for cap flexibility," said Peter Luukko, president of the Flyers' parent company, Comcast-Spectacor. That said, Bryzgalov had become a locker room distraction with his odd comments.

The Flyers may now pursue free-agent goalies Ray Emery or Evgeni Nabokov. Teams cannot talk to prospective free agents until July 3, and free agency starts on July 5.

"It's going to be a wild ride for the next little while," Holmgren said.

Steve Mason, who excelled in a seven-game stint after being acquired from Columbus late in the season, is the Flyers' No. 1 goalie. For now. He will be given the chance to win the job in training camp.

"I'm a big Steve Mason fan," Holmgren said. "He's a very young goalie and, for his age, has a lot of experience. Ideally, we'd be able to get a guy that would work in tandem with him."

Luukko said Holmgren met with him and club chairman Ed Snider after the season and the GM said buying out Bryzgalov would give the Flyers "the most flexibility to make our roster better."

The list of free agents who might interest the Flyers includes wingers Viktor Stalberg, Nathan Horton, Bryan Bickell and David Clarkson.

Asked if he felt comfortable with Mason as the primary starter, Holmgren said, "I trust him as one of two goalies, but I believe he has a bright future."

As for Bryzgalov, 33, he oozed of sarcasm when a reporter told him that the buyout decision had been made public, "Congratulations to you guys," he said.

Sources say Bryzgalov and Laviolette had many verbal spars during the season.

Asked to comment on his feelings on the buyout, Bryzgalov said: "I don't want to talk to you guys."

Bryzgalov had an up-and-down two-year stint after signing a $51 million, nine-year deal with the Flyers.

After his first season, Holmgren made it clear he wanted Bryzgalov to focus more on hockey and less on some of his bizarre comments.

"His job is to stop pucks and help us win games," Holmgren said at the time in a good-natured tone. "It's not Comedy Central."

But Bryzglaov seemed to be imploring the Flyers to buy him by continuing to be a distraction after this season.

In an interview with the Russian sports site Championat, he was quoted as saying he disliked the city of Philadelphia and that he admired Joseph Stalin, who ruled the Soviet Union for more than two decades.

It is not known whether those comments were lost in translation into English.

"He's said some off-the-wall things," Luukko said, "but this was strictly a business decision. Claude Giroux's (contract extension) is coming up and we want to be able to look at players in free agency and in the trade market."

Asked if Bryzgalov had become a distraction in the locker rooom, Flyers forward Brayden Schenn said, "I don't know. Everyone knows Bryz is Bryz. Some people may think he's a little differnet, but I'm not going to say one way or another. I'm sure you guys know how Bryz was."

Broadcaster Jeremy Roenick said Holmgren had made a "wise decision" to buyout the goalie.

"He struggled mightily and when you are paid a lot of money, you are expected to perform a certain way and act a certain way."

It would not be surprising if Bryzgalov ended up returning to play in his homeland, Russia. Ritch Winter, Bryzgalov's agent, did not return phone calls.

The Flyers last week announced they were buying out Danny Briere's contract; they thus have used both compliance buyouts that were created by the new collective bargaining agreement.