Southwest Airlines and a union representing its mechanics could be on the verge of ending a bitter, long-running labor dispute that has triggered hundreds of flight cancellations and raised safety concerns.

The two sides announced the tentative contract agreement late Saturday after six years of negotiations between Southwest and the Aircraft Mechanics Fraternal Association.

The deal still needs to be voted on by the roughly 2,400 mechanics who will receive a 20 percent raise if the contract is approved. The five-year contract also calls for $160 million in bonuses for the mechanics.

The agreement, reached in a week of mediation, came after the Federal Aviation Administration warned that the deteriorating relationship between Southwest and its mechanics threatened to undermine the airline's safety-management system.