USAir and the machinists union reached a tentative agreement on a new contract last night within seconds of a deadline set by the union for a strike.

The pact is subject to approval by members of the International Association of Machinists and Aerospace Workers, said Robert O. Harris, chairman of the National Mediation Board. No details of the agreement were released.

Harris had worked with both sides during negotiations.

The union had threatened a 12:01 a.m. walkout today of its 1,957 mechanics if no agreement was reached.

However, Jack King, spokesman for USAir, said the midnight shift had reported to work and the airline was operating normally.

Saturday, union negotiator Victor Mazzocco had said there was no progress in the talks and he was not optimistic a strike could be avoided.

At the time, Mazzocco said the main stumbling blocks were "primarily wages and a couple of concessions the company seeks that don't go over well with the membership."

He said the company was seeking "takebacks in pension and job protection areas."

The strike was threatened for the end of a cooling-off period ordered in the negotiations last month. The contract covering the employes, 1,229 of whom are based at Greater Pittsburgh International Airport, expired last October.

USAir officials said the airline had notified "about 2,000" pilots and flight attendants that they would be furloughed in the event of a strike.

A spokesman for Teamsters Local 732, which represents about 500 USAir baggage handlers, said its members would have stayed out in Pittsburgh, Philadelphia, Boston and Buffalo.

However, a USAir spokesman said the airline had ample manpower standing by to take over those responsibilities.

The airline had not had a strike in its 33-year history. USAir principally serves the Northeast but also has flights to the South, West and Southwest.