A bidder on eBay offered nearly $2.7 million to have lunch with the billionaire investor Warren Buffett, as part of an annual auction to benefit a nonprofit organization in San Francisco.

The winner, who was not named, offered $2,679,001 just minutes before the five-day auction closed on Friday. He or she, along with up to seven friends, will share a lunch with Mr. Buffett at Smith & Wollensky in Manhattan.

Mr. Buffett, the chief executive of Berkshire Hathaway, has been participating in this event since 2000. The money raised goes to support Glide, a nonprofit organization in San Francisco that provides a variety of services for poor and marginalized people including food — almost 800,000 meals per year — shelter and child care.

Glide has an annual budget of $18 million, Janice Mirikitani and Reverend Cecil Williams, the organization’s founders, said in a telephone interview.