The four-week-old strike at United Airlines ended late last night when the Air Line Pilots Association announced that it had voted to accept an agreement that will put 5,000 striking pilots and 8,000 flight attendants who had honored their walkout back in the air, starting this weekend.

The vote by the pilots' 30-member United executive council followed by two hours an announcement by the Association of Flight Attendants (AFA) that its members wanted to return to work, despite a failure to negotiate an acceptable back-to-work agreement with the nation's largest airline.

The action by the two unions means that United will shortly be able to resume its daily schedule of 1,500 flights to all 50 states and 10 foreign destinations. But the airline faces extended court battles with both the ALPA and the AFA, which last night vowed to fight company efforts to award seniority to pilots and flight attendants who did not strike.

The pilots' settlement, approved at a Chicago hotel just before midnight CDT, includes a two-tier wage system -- the company's key contract demand -- that will sharply reduce United's labor costs as the airline hires new pilots for an expansion of overseas operations.

The dual wage scale provides that pilots hired under the new contract will earn $27,792 after five years, more than 50 percent less than the $60,456 that pilots with five years' experience now make.

The ALPA would not comment on terms of the new pact, and scheduled a news conference today in Chicago to outline its back-to-work plans and legal strategy.

United had operated only about 15 percent of its normal schedule during the strike, which began May 17, and the airline had said it could begin increasing its daily schedule immediately upon settlement. However, United officials said it would take a week to return to full service.

A key part of the settlement allows a federal judge in Chicago to decide two of the most troublesome issues that prolonged the strike: whether 570 new pilots who were trained by United but refused to cross the picket lines have the right to be hired after the strike, and whether United can give higher seniority to employes who did not honor the strike.

Joe Hopkins, a United spokesman, said the company was "satisfied with the contract agreement." He said United will announce its schedule resumption Monday.

"Our goal is to maintain our integrity and reliability," Hopkins said. "We will not be rushed . . . . We want to come back in an orderly manner."

The ALPA had pledged to delay its back-to-work vote until the flight attendants reached an "honorable" pact with United. But the pilots voted to return to work after the AFA released them from their pledge because the union said it was unable to reach an agreement after three days of negotiations.

In a lengthy statement attacking United for seeking "savage reprisals" against attendants who supported the strike, the AFA urged the pilots to return to work. Speaking for the AFA, Patricia Friend said the union would fight in court United's effort to take away seniority rights of attendants who honored pilots' picket lines.

"The savage and ruthless way in which this company has sought to treat loyal and dedicated flight attendants who built United into the largest airline in the free world is beyond comprehension by reasonable people," the AFA statement said.

Loss of seniority could force veteran attendants to move to new cities because those who crossed picket lines would be given first choice of home bases, AFA said.

United spokesmen declined comment on the AFA statement.

According to company and union spokesmen, the strike had been prolonged by conflict over United's prestrike commitment that employes who worked during the walkout would receive advanced seniority -- which usually means higher pay.

"There is a lot of money at stake in the back-to-work issue and a principle" of seniority for both AFA and ALPA, pilot spokesman David Jewell said.

Many of the striking pilots and the flight attendants stand to lose their seniority ranking because United has "re-bid" job assignments, according to a company spokesman who asked not to be identified.

The 250 ALPA pilots who have crossed picket lines could receive raises of as much as $60,000 a year, he said, because they were able to bid for jobs flying the largest planes.

Pilots flying 747s during the strike are being paid at a rate of $151,000 annually, compared with an average of $90,000 for captains of smaller planes, he said.

The pilots' contract, tentatively settled May 24 but delayed by the seniority dispute, gives current pilots a 9.5 percent pay increase over three years. The average of $90,000 for veteran United pilots is substantially higher than salaries at nonunion airlines.

However, the contract will cut pay dramatically for new hires, under the two-tier system that was the company's primary bargaining demand.

United had sought a 20-year term for the pay scale for new hires, but the agreement approved last night calls for five years, followed by negotiation and arbitration to determine what happens then.