American Airlines parent AMR Corp. and US Airways Group Inc. are hashing out the last major details of a merger agreement that would create the world's largest airline and are racing to finalize a deal, said people close to the discussions.

If the deal is reached, the new company could have a market capitalization of more than $10 billion and would vault ahead of United Continental Holdings Inc. as the biggest U.S. airline by traffic. The all-stock deal would be executed as a reorganization plan that takes American out of Chapter 11 bankruptcy protection.

The people cautioned the merger negotiations remained fluid and could fall apart. American has resisted a deal at various points in favor of emerging from bankruptcy protection as an independent airline. Significant points of the deal, including how to split ownership of the airline and how to arrange board seats and management ranks, remain unresolved. The boards of both airlines haven't yet convened to consider the deal, although American representatives on Wednesday discussed whether to schedule such a meeting, said a person close to the matter. It could take another couple of weeks for an agreement to be completed, the people said.

The discussions are now at an advanced stage, with AMR Chief Executive Tom Horton, US Airways CEO Doug Parker, and a small circle of advisers negotiating the merger's finer points. Under the deal's current contours, American creditors would own roughly 72% of the airline and US Airways shareholders about 28%, people close to the discussions said.

Mr. Parker is in line to run the combined airline as CEO, they said. Mr. Horton, meanwhile, could become nonexecutive board chairman for a limited time, though his exact role remained in flux and there were some discussions about him becoming executive chairman—a more powerful position. American's board is interested in Mr. Horton having some kind of role to ensure the merger's potential financial benefits are realized, one of the people said.