Theme-park operator Six Flags, which has been struggling with falling attendance and a large debt load, said Thursday it will sell seven of its parks for $312 million.

Shares of Six Flags gained 41 cents, or almost 8%, to $5.84 in afternoon trading on the New York Stock Exchange after the news.

The sale comes after Six Flags found itself on a management roller coaster ride in recent years. Mark Shapiro, former head of entertainment at ESPN, became chief executive of the company in December 2005 following a proxy fight led by investor and Washington Redskins owner Daniel Snyder that resulted in the ouster of former CEO Keirian Burke and other executives.

The company said the sale is part of its strategy to reduce debt and enhance its operational and financial flexibility. Six Flags had total long-term debt of $2.1 billion as of Sept. 3, 2006, when it filed its most recent quarterly report.

Six Flags spokeswoman Wendy Goldberg said the company is not actively looking to sell any more parks.

Combined with the June 2006 sale of land underlying its Houston AstroWorld theme park for $77 million, the sale will result in proceeds of $352 million to be used for debt reduction, according to the company.

The parks are being bought by Jacksonville, Fla.-based park operator PARC 7F-Operations Corp., but PARC will simultaneously sell them to Orlando-based real-estate investment trust CNL Income Properties. CNL will then lease the parks back to PARC.

The seven parks include Six Flags Darien Lake in Buffalo, N.Y.; Six Flags Elitch Gardens in Denver; Frontier City and the White Water Bay water park in Oklahoma City; SplashTown in Houston; Waterworld USA in Concord, Calif.; and Wild Waves and Enchanted Village in Seattle.

While the Darien Lake and Elitch Gardens sites will not longer carry the Six Flags brand under the new ownership, any 2007 season passes purchased at the parks will continue to be honored at all Six Flags branded parks for the 2007 season.

The deal is expected to close in March, subject to customary closing conditions.

Six Flags reported last month that 2006 attendance slipped 14% from the previous year. In November, the company said third-quarter earnings fell 16% to $159.3 million, or $1.08 per share, below Wall Street’s expectations. Revenue in that quarter slid 1% to $540.7 million.