Striking FairPoint Communications workers will begin voting Friday morning in Portland on whether to ratify a new contract that would end more than four months of labor strife.

The company, which provides much of the landline phone service in northern New England, and striking members of the International Brotherhood of Electrical Workers and the Communications Workers of America reached a tentative agreement on a new contract Thursday afternoon.

“Things really worked out well,” Peter McLauglin, business agent for the IBEW’s Augusta local and one of the negotiators for the union, said Thursday night. “We were able to achieve most of the things we set out to do, especially protecting good jobs.”

McLaughlin said the deal was reached after “pretty hard, steady progress. It was slow and tedious. Painful at points and some late nights.”

Neither side would release details of the settlement that helped them bridge a $500 million gap separating them last summer.

FairPoint said it needed $700 million in cost cuts to remain competitive in the market. The company wanted to freeze pensions, eliminate its health care coverage for retirees and have employees pay 20 percent of their health care insurance premiums. The company also sought changes in work rules that would allow it to hire more outside contractors.

The unions, which represent about 1,700 workers in northern New England, including 800 in Maine, responded with $200 million in cuts, but said they could go no further.

The company declared an impasse in August and imposed the terms of its last contract offer. Workers walked off the job Oct. 17.

The union had no strike fund to pay workers while they picketed, but union leaders said most workers had prepared for the walkout by lining up part-time jobs. The company brought in replacement workers, but regulators in Maine, New Hampshire and Vermont said customers’ complaints about service were piling up. New Hampshire officials held up a $13 million contract with the company in December, citing poor service.

Both sides and federal mediators put out identical statements Thursday saying that the new contract will keep workers’ wages and benefits “among the best in New England” while enabling the company “to achieve a much more competitive position in the marketplace.” Federal mediators, who called both sides back to the bargaining table in early January, said there would be no further comments until after a ratification vote.

If the new contract is approved, workers will return to their jobs Wednesday.

McLaughlin doesn’t anticipate any problems getting the contract ratified, although he didn’t want to predict that it will pass.

Union leaders posted a schedule of ratification meetings online Thursday afternoon, with the first one set for Friday in Portland. The union said it will share details of the proposed contract at the meetings, answer questions and then hold ratification votes. Meetings also will be held Friday afternoon in Bangor, Saturday in Presque Isle and Sunday in Augusta.

Meetings also are scheduled this weekend in New Hampshire and Vermont. Union officials said they won’t announce the results until after the last meetings are over. Those meetings, in Augusta and Burlington, Vermont, are scheduled to start at 9 a.m. Sunday.

FairPoint provides service in 17 states. Northern New England is its largest market, with about 1 million phone lines.

The North Carolina-based company bought Verizon’s landline operation in the region for $2.3 billion eight years ago. It sought bankruptcy protection less than two years later, saying it had lost customers because of operational and integration problems.

FairPoint emerged from bankruptcy protection in 2011 but has continued to struggle financially.

The strike, which entered its 127th day Friday, is the longest in the telecommunications industry this century. The IBEW and CWA called strikes against Verizon in 2000 and 2011. The first occurred when 85,000 workers walked off the job to protest overtime issues and preserve union jobs in the wake of the merger of Bell Atlantic and GTE, which created Verizon. That strike lasted from Aug. 5-23. The second strike, involving 45,000 workers, started Aug. 7 and lasted until Aug 22. Workers struck to prod management to bargain seriously on a new contract.

A third strike involving the CWA lasted two days in August 2012 and involved 20,000 AT&T workers who protested unfair labor practices during contract negotiations.