SAN FRANCISCO — Google and the Federal Trade Commission are near a $22.5 million settlement agreement related to charges that Google bypassed privacy settings in Apple’s Safari browser to show advertisements, according to a person briefed on the proposed settlement.

The $22.5 million fine would be the largest privacy-related settlement in F.T.C. history. It comes as the commission investigates Google for antitrust violations and cracks down on privacy missteps by tech companies, including Google, which last year agreed to pay for any future privacy blunders as part of a separate F.T.C. settlement.

A spokesman for the commission, Peter Kaplan, declined to comment. Chris Gaither, a Google spokesman, also would not comment on the settlement, but said, “We do set the highest standards of privacy and security for our users.”

The case involves how Google shows users personalized Web ads based on their interests. Google’s DoubleClick ad network customizes ads based on sites that users have previously visited, and ads they have recommended to friends by using the Google +1 button. To do this, Google uses cookies, small files that allow Web sites to do things like identify the types of Web pages a user visits.

If you have visited travel Web sites or recommended ads for resorts, for instance, Google might show you vacation ads on the next Web site you visit.

Safari, unlike other browsers, blocks cookies from ad networks like Google’s. But because of a loophole, Google had been able to avoid the block, as researchers discovered in February. It installed cookies and tracked Safari users across the Web to show them personalized ads.

At the time, Google said this was unintentional and had resulted from a change in Safari of which Google was unaware. When the issue was brought to Google’s attention, the company said, it stopped using the cookies and showing personalized ads on Safari browsers. It also changed an out-of-date page in its help center that gave Safari users inaccurate information about ad-related cookies.

“We have now changed that page and taken steps to remove the ad cookies, which collected no personal information, from Apple’s browsers,” Google said in a statement Tuesday.

Google will not claim liability for the privacy violations, according to a person briefed on the settlement, which was first reported by The Wall Street Journal. Google agreed to settle in part to avoid a court battle while it faces broader regulatory investigations by the F.T.C., the person said. The settlement is subject to approval by the agency’s commissioners.