After months of haggling, Exxon Corp. and Mobil Corp. are near an agreement with government regulators that would allow the oil giants to complete their $81 billion merger, according to sources close the talks.

Under terms being discussed, the companies would shed more than 1,500 service stations, with Exxon divesting 500 stations in New England and New York and Mobil selling off 1,000 stations, most of them in Northern Virginia and New Jersey. The divestitures are intended to the ease fears that the combined companies would control enough of the retail market in certain areas to raise prices at the pump.

In December 1998, Exxon and Mobil announced that they intended to merge, creating what would be the world's largest oil company. In recent months, lawyers for the companies have been negotiating with staff members at the Federal Trade Commission, which can sue to block the merger if it concludes the deal will hurt consumers.

Officials at the FTC declined comment. Neither Exxon nor Mobil would discuss the matter.

"We're not commenting on any of the details of our discussions with the regulatory agencies," said Exxon spokesman Ed Burwell. "What we are saying is that the discussions continue with both the FTC and the state attorneys general."

Exxon has also reportedly agreed to sell off a refinery in Benicia, Calif. The parties also are set to agree that the companies will be granted a certain amount of time to find buyers for their assets, sources said. If the companies don't meet the deadlines, they would be required to sell off even more stations and perhaps another refinery.

Sources have said that the talks have dragged on longer than expected, but that the merger is far too valuable to Exxon and Mobil to founder over the sort of divestitures that the FTC is demanding.

Shares of the companies, which intend to continue operating both brands, rose yesterday, with Exxon up 75 cents, to $74.37 1/2, and Mobil up $1.18 3/4, to $97.62 1/2.