(Reuters) - CBS Corp’s CBS.N board on Thursday voted to end Shari Redstone’s control of the media company, but the move will not take effect unless a Delaware judge sides with CBS in its litigation to stop a potential merger with Viacom Inc VIAB.O.

The board approved 11-3 a special dividend that would cut the Redstone family’s stake to about 20 percent from 80 percent, CBS said in a statement.

The Redstone family’s National Amusements Inc controls both CBS and Viacom. NAI has said it wants to merge them if both companies support the deal.

The action is the latest twist in the fast-moving battle for control of the CBS boardroom. Redstone has long favored reuniting the companies that split in 2005, but she has run into objections from CBS Chief Executive Leslie Moonves. No date has been set for Chancellor Andre Bouchard, the judge on Delaware’s Court of Chancery, to resolve the conflict.

“The board of directors has taken this step because it believes it is in the best interests of all CBS stockholders, is necessary to protect stockholders’ interests and would unlock significant stockholder value,” CBS said in a statement.

NAI on Wednesday, however, amended the company’s bylaws to require a supermajority of 90 percent to approve the issuance of a special dividend.

“In light of the board’s action today, that action was plainly necessary, and it is valid,” NAI said in a statement.

FILE PHOTO: The CBS television network logo is seen outside their offices on 6th avenue in New York, U.S. on May 19, 2016. REUTERS/Shannon Stapleton/File Photo

“CBS management and the special committee cannot wish away the reality that CBS has a controlling shareholder,” it added.

Shares of CBS ended down 4.1 percent on the New York Stock Exchange at $51.61 but rose 0.8 percent after hours. Shares of Viacom slipped 0.4 percent to $28.16 on Nasdaq and were little changed after hours.

Shari Redstone attended the board meeting in person in New York, according to sources familiar with the matter.

Sources told Reuters ahead of the meeting that the CBS board planned to argue that Redstone’s bylaw amendment did not apply because in the company’s view such changes require a 20-day notice period.

CBS plans to challenge the bylaw in court, two other sources told Reuters on Thursday.

Earlier on Thursday, Chancellor Bouchard sided with Redstone by denying a request by CBS for a temporary restraining order to bar Redstone from amending bylaws or sacking directors ahead of the board meeting.

Fears that Redstone would replace Moonves sent CBS shares down as much as 6 percent after the ruling.

Bouchard said in his ruling he could set aside Redstone’s bylaw amendments if CBS shows they are invalid or unfair, implying that the bylaw was in place.

“The ruling clearly recognizes that we may bring further legal action to challenge any actions by NAI that we consider to be unlawful,” CBS said in a statement.

NAI welcomed Thursday’s ruling, and said CBS’ special committee had breached its fiduciary obligations to CBS shareholders.

The fight for control of the CBS boardroom was put in motion on Sunday, when CBS’s special committee determined a merger with Viacom was not in the interest of CBS shareholders.

National Amusements believes a deal is needed for the two media companies to gain scale and compete with the likes of video-streaming company Netflix Inc NFLX.O and Amazon.com Inc AMZN.O.