At a time when many investors and lenders are doing everything they can to avoid risk, American Airlines parent AMR ( AMR) stepped up last week and made a bold bet on the future.

The world's largest airline announced what could become the biggest aircraft order in its history, saying it wants 42 Boeing ( BA) 787-900s, with options for 58 more. The list price for 100 airplanes is close to $20 billion, although carriers never pay the full price and they don't disclose the exact cost.

For American, the order compares with one it placed in three tranches between 1982 and 1987 for 260 MD-80s. Those jets were key to American's dominance in the 1990s. Taking all 100 Boeing planes would enable American to operate the second-largest 787 fleet in the world -- assuming Australia's Qantas acquires all 115 airplanes in its own order -- and to maintain a dominant international role.

"We remain focused on the future even as we battle through the present," said CFO Tom Horton, on an earnings conference call last week.

The order comes at an unusual time in the business cycle, says Bill Swelbar, a research engineer in MIT's International Center for Air Transportation. "Historically, airlines have ordered airplanes at the top of the cycle, but American is willing to step up at a time that is toward the bottom. They are saying 'we are willing to commit this company and its capital, because we are going to be here for the long haul.'"

Just five months ago, with Boeing trading in the $80s and American approaching a three-year low around $7, it would have been hard to imagine that American would arrive to bolster Boeing's outlook in an hour of need.

Yet today, Boeing trades near its four-year low, hurt by the economic downturn and a crippling strike that further muddies its 787 delivery schedule, while American and the U.S. airline industry appear well-positioned to withstand a downturn, thanks in part to dramatic capacity cuts.

For now, it's unclear whether American has committed any cash to the order. Boeing spokesman Jim Prouix says that "a fully booked order includes a prepaid deposit at the time of order," but neither side would comment on specifics. The deal is contingent on American's ability to reach an agreement with its pilots on a 787 pay rate.

The order speaks to the transformation American has undergone in the past few years. At the end of 2002, it had net debt of $19 billion. The following spring, it flirted with bankruptcy. AMR's shares dipped to $1.25 before the company reached an 11th-hour cost-cutting deal with its unions.

By the end of this year's third quarter, net debt had declined more than 40% to $10.7 billion. Additionally, American is benefiting from its ability to avoid bankruptcy, unlike many other legacy carriers, such as United ( UAUA) and Northwest ( NWA), this decade.

"It should matter to the capital markets who pays you back and who doesn't," said CEO Gerard Arpey, on an earnings conference call last week. "It should matter, and it does matter."

Says Swelbar: "By avoiding bankruptcy, they created tremendous good will with all the creditors they work with, despite a labor-cost structure that is not competitive."

With its 787 order, American went to the head of the line. Its first delivery is scheduled for 2012, while others must wait years longer.

"We've been saying for a long time that by virtue of our long-term agreement with Boeing, we have access to 787s," said Horton, on the conference call. "This is just a manifestation of what we've been saying." Commercial Aviation Online said a 1997 contract with Boeing ensured that "American gets aircraft in the future when it wants them."

Still, it remains unclear just how difficult a pilot agreement will be. American and its pilots have been in contract talks since September 2006. Pilots want to reclaim 2003 concessions that cut their pay rates by 23.5% as part of the bankruptcy-avoidance package, but analysts expect the carrier to lose over $1 billion this year.

Last week, the Allied Pilots Association said "enthusiasm over any aircraft orders will be somewhat tempered" by the slow pace of contract talks. But with new airplanes, American is stronger and pilots' career prospects will improve.

Today, commercial aviation is aligned in three competing global alliances. Delta ( DAL), Air France KLM and Northwest are in Skyteam. United and Lufthansa head Star Alliance. American, British Airways and Japan Air Lines are in Oneworld.

Recently, members of each have sought to add or expand their antitrust immunity in order to coordinate pricing and scheduling with key partners. American wants immunity for a trans-Atlantic partnership with British Airways and Iberia, and says it would use 787s within that arrangement.

"American is looking down the road and getting ready to compete with some very large airlines," says aviation consultant Darryl Jenkins. "They know that if you're not making a plan right now for 10 years from now, then you're going to be left out of the global marketplace."