Pepco’s union on Thursday approved a four-year contract with the company, averting a strike that had worried local officials and residents for weeks, company and union officials said Friday.

Last month, an overwhelming majority of union members voted to reject what the company had called its “last, best and final” offer. Immediately after the vote, union leaders and company officials went back to the negotiating table, and they reached a tentative agreement with Pepco two weeks ago.

On Thursday, a “comfortable majority” of the union’s membership voted to approve the agreement, said James A. Griffin, president of the union International Brotherhood of Electrical Workers Local 1900. The turnout was about 90 percent.

The contract keeps the wage increases that the company offered in its “last, best and final” offer. Over four years, workers will get an additional 2.25 percent the first year and then 2.5 percent annually. They have received annual wage increases of 2 percent or more since 1999, the company has said.

But Griffin said the union’s problem with the previous proposal wasn’t with the money. He said his greatest concern was that Pepco wanted to eliminate the union’s ability to arbitrate changes to its health and welfare plans in favor of a different appeal process. In the tentative agreement, the company agreed to an arbitration process, Griffin said.

Pepco spokeswoman Myra Oppel declined to comment on details of the contract. In an e-mail Friday, she said Pepco is “happy” with the agreement and declined to comment further.

Pepco has said it would not give workers retroactive increases on wages and benefits because its previous offer was rejected. The increases totaled about $1.1 million, or $1,000 a worker. Griffin said the union negotiated a lump-sum payment to compensate workers for the lost retroactive wages.

The company and union were at an impasse for months, and officials from both sides said they thought a strike was a real possibility. The old contract was set to expire in May.

The dispute involved Pepco’s linemen and electricians, the workers who are key to restoring service during outages. Amid widespread consumer resentment over service shortfalls and outages after last summer’s derecho storm, Pepco was concerned with the possibility that much of its workforce would walk out.

Most of the new contract is effective immediately, Griffin said. Some of the wage increases won’t go into effect for a few weeks, and changes to the union’s health and welfare plans won’t go into effect until Jan. 1.