Sumner Redstone, executive chairman of CBS Corp. and Viacom, arrives at the premiere of 'The Guilt Trip' in Los Angeles, Dec. 11, 2012. REUTERS/Fred Prouser

A psychiatrist who examined Sumner Redstone twice last month found the 93-year-old retained the mental capacity needed to remove Viacom Inc. Chief Executive Philippe Dauman from the trust that will eventually control the company, according to a spokesman for the media mogul.

Dr. James Spar said Redstone displayed only a "mild degree" of age-related cognitive impairment when he saw the mogul at his Los Angeles area home on May 20 and May 24, according to a statement issued by Redstone's spokesman on Thursday.

Spar concluded Redstone had the "legal mental capacity" required when he removed Dauman and Viacom board member George Abrams from the Sumner M. Redstone National Amusements Trust on May 20, the statement said. The trust will determine the future of Viacom and CBS Corp. when Redstone dies or is declared mentally incapacitated.

Redstone is the controlling shareholder of both companies, and his mental status is a subject of dispute. Dauman and Abrams have sued to reverse their removal from the trust, arguing that Redstone is under undue influence of his daughter, Shari Redstone. She has called that allegation "absurd" and said her father made his own decisions.

The outcome of the court case, and who ends up with control over the trust, will have wide-ranging implications for shareholders of CBS and Viacom, the owner of cable TV networks such as MTV and Nickelodeon.

Redstone told Spar he felt Dauman had "done a bad job running Viacom" and he was upset with Dauman's decision to sell part of movie studio Paramount Pictures, according to the statement from Redstone's spokesman.

Spar is a specialist in geriatric psychiatry at the University of California, Los Angeles. The doctor has examined Sumner Redstone numerous times since 2014, according to the mogul's spokesman.

Les Fagen, an attorney for Dauman, said in a statement that Spar's evaluation was the work of a "paid medical expert" and did not answer whether Sumner Redstone "had sufficient capacity to make complex decisions impacting the governance of billion dollar publicly held corporations" or "acknowledge that undue influence was exercised".

Fagen said a "complete and objective" examination was needed.

Regarding Paramount Pictures, Fagen said there is not yet a deal to oppose. "Such a deal if it matures will be the subject of evaluation and review by all board members," Fagen said.