A JetBlue Airways Corp. plane taxis next to American Airlines Group Inc., Delta Air Lines Inc., and Alaska Airlines Inc. aircraft at Reagan National Airport (DCA) in Arlington, Virginia, U.S., on Monday, April 6, 2020.

Several U.S. airlines on Tuesday said they reached agreements with the Treasury Department for billions in government grants aimed at softening the blow from the coronavirus.

Shares of airline stocks initially rallied on the news but were trading lower on Wednesday.

The virus and harsh measures to stop it from spreading, such as stay-at-home orders, have driven air travel demand to the lowest levels in decades. Carriers have grounded hundreds of jetliners and are asking thousands of employees to take voluntary unpaid leave, in a race to cut costs as cancellations outpaced bookings.

Airlines including American, Delta, United, Southwest, Spirit, JetBlue and Alaska, applied for portions of $25 billion in payroll grants -- airlines' largest ever government aid package -- that require airlines not to furlough or cut the pay rates of employees through Sept. 30. U.S. airlines employ some 750,000 people. The grants were part of the more than $2 trillion coronavirus relief package, the CARES Act, which was signed into law last month.

American said the Treasury Department approved $5.8 billion in assistance — a $4.1 billion grant and a $1.7 billion low-interest loan. The Fort Worth, Texas-based carrier said it plans to apply for another government loan of around $4.75 billion.

"By accepting these funds, we have happily agreed to not involuntarily furlough or reduce the hourly pay rates of our U.S.-based team members through Sept. 30, at which point we hope and expect that Americans are regularly flying again," American's CEO, Doug Parker, and the airline's president, Robert Isom, wrote to employees announcing its deal with the Treasury Department.

Dallas-based Southwest said it expects to receive $3.2 billion under the program, more than $2.3 billion in payroll support and a 10-year low-interest loan of close to $1 billion. The loan will likely include 2.6 million warrants for the Treasury Department, and that the aid prohibits share repurchases and dividends until Sept. 30, 2021, and requires limits on executive compensation for nearly two years, the airline said.

Delta said it reached a deal with the Treasury Department for $5.4 billion, including a 10-year, $1.6 billion, unsecured-loan and the airline will give the government warrants to acquire around 1% of the Delta stock at $23.39 a share, last Friday's closing price, over five years. New York-based JetBlue said it will get $935.8 million, close to $251 million as a loan.

"We welcome the news that a number of major airlines intend to participate in the Payroll Support Program," the Treasury Department said in a statement. "This is an important CARES Act program that will support American workers and help preserve the strategic importance of the airline industry while allowing for appropriate compensation to the taxpayers."

Other airlines are planning to detail their expected portion of the aid Tuesday or later this week, people familiar with the discussions said.

Talks had dragged on for longer than some carriers expected. The Treasury Department last week proposed that airlines pay back 30% of the grants, terms that appear to have stuck, at least with American and Southwest. Lawmakers and labor unions objected to those terms, saying the aid package Congress passed last month intended that the funds would be structured as payroll grants. The Treasury Department last week said airlines seeking less than $100 million would not have to provide that compensation for the funds.

Sara Nelson, president of the Association of Flight Attendants, which represents about 50,000 cabin crew members at airlines including United and Spirit, and had pushed lawmakers to dedicate a portion of the aid solely for workers, applauded the progress toward disbursing the aid.

"This is an unprecedented accomplishment — a truly workers-first stimulus that keeps people connected to their jobs and provides stability and hope to millions of aviation workers and sets a template we must now work to extend to every worker," she said in a statement.