American Airlines pilots agreed to a new contract on Friday, their union said, paving the way for the carrier to come out of its yearlong bankruptcy.

The Allied Pilots Association said the new collective bargaining agreement was endorsed by 74 percent of pilots who cast a ballot. Last August, in a surprise move, American’s pilots overwhelmingly rejected a similar deal with the airline.

With a new contract, American Airlines has mostly completed its reorganization. This was the last big hurdle to clear before the carrier and its creditors could focus on the big strategic question looming ahead: should American pursue a merger with US Airways or remain independent for now?

Photo Credit: An American Airlines passenger jet glides in under the moon as it lands at LaGuardia, August 28, 2012. Eduardo Munoz / Reuters