SAN FRANCISCO — Alphabet’s board of directors agreed to pay a former top Google executive as much as $45 million when he resigned from the company in 2016 after being accused of groping a subordinate.

The previously undisclosed sum was in the separation agreement for Amit Singhal, a senior vice president who ran Google’s search operations until February 2016. The amount was revealed on Monday in a shareholder lawsuit accusing the board of directors of Alphabet, the parent of Google, of shirking their responsibilities by agreeing to pay executives accused of misconduct instead of firing them for cause.

The suit was part of the fallout over how Google has handled sexual harassment cases. The New York Times reported in October that Google had handsomely paid several high-ranking executives in separation agreements after they were credibly accused of sexual harassment, even though the men could have been fired for cause. In one case, Google handed a $90 million exit package to Andy Rubin, who used to head its Android division, after he was accused of sexual misconduct.

The shareholder lawsuit was filed in January in California Superior Court with redactions in the passages referring to board discussions. An amended version was filed on Monday without the redactions.