The first strike in the 89-year history of Potomac Electric Power Co. ended yesterday after five days as negotiators reached a tentative settlement after a tense 24-hour marathon bargaining session.

The 3,300-member union, Local 1900 of the International Brotherhood of Electrical Workers, immediately pulled down its picket lines at a dozen Pepco plants when the agreement was announced by federal mediators after all-night talks that ended about 10 a.m.

Power plant workers, line workers, meter readers, computer specialists, customer service workers and other union members were to begin returning to their jobs on the midnight-to-8 a.m. shift early today, officials said.

Sources said both sides eventually compromised on each key issue in dispute, including health benefits, extra pay for night-shift work, pensions and wages. Full details of the settlement were not available.

"We are delighted to have our team coming back," said Pepco Senior Vice President Paul Dragoumis.

He said the giant utility had no serious problems serving its 1.75 million customers during the strike, but he added, "We have a reputation for service, but we couldn't really maintain that without our full team."

During the strike, Pepco used 1,800 supervisors and clerical workers, supplemented by several hundred employes of outside contractors, to maintain basic service to 570,000 homes and businesses in the District, Maryland and a small part of Arlington County.

During the strike, Pepco suspended most new service connections, sent estimated bills instead of actual meter readings, and said it would suspend some night repair work.

Officials said Pepco hopes to resume normal operations tomorrow.

Pepco and union officials agreed as part of the settlement not to disclose any terms of the tentative contract until union members vote by secret ballot in a work site vote this week.

Both sides said they were pleased with the results of negotiations conducted with the aid of federal mediator Charles Scott at the downtown headquarters of the Federal Mediation and Conciliation Service.

"I think it is a very fair settlement. Nobody got everything they wanted, but we are pleased. We feel we made some substantial gains," said union president Terry Cross.

Pepco's record-high profits -- $168 million in 1984 -- were raised as an issue at the bargaining table by the union, which contended that the company could afford higher raises and benefits than originally offered.

The union strongly resisted the company plan to require workers to pay up to $175 more annually in health insurance deductibles and other health costs.

Pepco had offered raises totaling more than 13 percent over three years, along with improved benefits, but it said the higher health deductibles were necessary to curb vastly increased medical costs.

Many union members earn $10 to $15 an hour and said salary was only one of several key concerns that prompted the walkout that began Tuesday.

Pensions emerged as a major issue because of a recent federal law that will require pension plans, beginning in 1987, to give workers pension credit starting at age 21. Currently, pension credit begins at age 25 for most covered employes.

While the new law will require Pepco to credit new employes from age 21, the union argued that all workers should receive such credit retroactively if they worked before age 25.

Union sources said Pepco finally agreed to that early yesterday, but company officials were not available for comment.

Another major stumbling block had been differences over "premium pay" for evening and night work. Pepco offered to increase its 50 cents-per-hour differential to 65 cents, while the union sought a $1-per-hour premium.

The mood during the lengthy bargaining sessions seesawed between optimism and gloom as Scott shuttled between company and union negotiators caucusing in separate rooms and periodically meeting in face-to-face sessions.

Scott, initially optimistic when talks began at 10 a.m. Friday, reportedly said late Friday night he was "discouraged," but he kept the parties talking in the hopes of an agreement.