Safeway general counsel Robert Gordon found himself in hot water last week, after a joke he made at the company’s annual meeting had him branded a sexist. Now, as part of the company’s efforts to clean up the public-relations mess, Gordon and CEO Steve Burd have both sent formal letters of apology to the joke’s powerful targets: Secretary of State Hillary Clinton and former Speaker of the House Nancy Pelosi.

The SF Gate’s Bottom Line blog posted the text of Burd’s letter to Clinton and Pelosi, which mentioned that “Mr. Gordon has sent a letter of apology directly to both of you.” Burd went on to offer his own act of contrition to the two women, writing:

The joke was inappropriate and I deeply regret that this has obscured the respect we hold for you and for your service to our nation. We intend to do all we can to prevent something like this from happening in the future.

The apologies from the supermarket-company executives may not have been entirely voluntary. George Miller—a Democratic congressman who represents California’s Bay Area, where Safeway is headquartered—led a delegation of local lawmakers in calling for the company to address the matter. According to the Gate, the congressional delegation “demanded an apology to Pelosi and Clinton, among other ‘corrective steps,’ for the ‘shocking lack of respect, not only for two of the most important and respected people in our country but for all women.’ “

Miller’s office was “not impressed” with Gordon’s initial public apology, which said:

I sincerely apologize if the opening comments I made at the recent annual stockholders meeting offended anyone. As these comments have been interpreted, they are not a reflection of my personal beliefs or that of my employer. I understand how my comments have impacted others and I hope they will accept my apology.